It is common to confuse the equality operator with the assignment op.docx - It is common to confuse the equality operator with the assignment operator

It is common to confuse the equality operator with the assignment op.docx

This preview shows page 1 - 3 out of 3 pages.

Image of page 1
It is common to confuse the equality operator with the assignment operator because the equality operator looks like ______ and the assignment operator looks like ________ Solution the assignment operator (=) and the equality operator (==) appear to be similar but are used for completely different reasons. The assignment operator (=) is used to assign a value to a variable, element of an array, or property of an object. Here are a few examples of using the assignment operator: // Set a variable to a value. var userName = \"Jack\"; // Set an element of an array to a value. namesArray[3] = \"Jack\"; // Set a property of a object to a value. nameClip._visible = FALSE; The equality operator (==) is used to compare two values or
Image of page 2
Image of page 3

You've reached the end of your free preview.

Want to read all 3 pages?

  • Fall '19
  • Equals sign, relational operator

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture