Jump to content

buyerguy5

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About buyerguy5

  • Rank
    Newbie
  1. Hi, I am a novice at javascript and I am hoping the forum can help me out with a question:Given the following code:var x = 8;var y = x;var x = x+4;alert(y);The result is y=8Meaning, when you change the value of x (after the statement y=x), y doesn't correspond to x anymore.Is it possible to have y change with x all the time- is this doable?I thought in other languages, if you do y=x, it will permanently associate y with x so that every time x changes, so does y.How can this be done in javascript?Thanks
×
×
  • Create New...