Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

What is the different between variable == 1 and variable = 1?

Guest
May 06, 2014 May 06, 2014

What is the different between variable == 1 and variable = 1?

One = sign and Two = signs?

TOPICS
ActionScript
152
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 06, 2014 May 06, 2014
LATEST

the double equal (==) is used for testing equality.  the single equal (=) is the assignment operator.

var1 = 1;  // assigns the value of 1 to the variable var1

if(var1==1){

// this executes if var1 has a value of 1

} else {

// this executes if var1 has a value other than 1

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines