|
56 | 56 | * @submodule Comparison Operators |
57 | 57 | */ |
58 | 58 |
|
59 | | -/** |
60 | | - * The equality operator <a href="#/p5/==">==</a> |
61 | | - * checks to see if two values are equal. |
62 | | - * |
63 | | - * Unlike, the strict equality operator, <a href="#/p5/===">===</a>, if |
64 | | - * the values being compared are not already the same type they will be |
65 | | - * converted to the same type before comparison. |
66 | | - * |
67 | | - * A comparison expression always evaluates to a <a href="#/p5/boolean">boolean</a>. |
68 | | - * |
69 | | - * From <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators">the MDN entry</a>: |
70 | | - * The equality operator converts the operands if they are not of the same type, then applies strict comparison. |
71 | | - * If both operands are objects, then JavaScript compares internal references which are equal when operands refer |
72 | | - * to the same object in memory. |
73 | | - * |
74 | | - * @property == |
75 | | - * |
76 | | - * @example |
77 | | - * <div class='norender'> |
78 | | - * <code> |
79 | | - * console.log(1 == 1); // prints true to the console |
80 | | - * console.log('1' == 1); // prints true to the console |
81 | | - * </code> |
82 | | - * </div> |
83 | | - */ |
84 | | - |
85 | 59 | /** |
86 | 60 | * The strict equality operator <a href="#/p5/===">===</a> |
87 | 61 | * checks to see if two values are equal and of the same type. |
88 | 62 | * |
89 | | - * Unlike, the equality operator, <a href="#/p5/==">==</a>, |
90 | | - * regardless of whether they are different types |
91 | | - * the values being compared are not converted before comparison. |
92 | | - * |
93 | 63 | * A comparison expression always evaluates to a <a href="#/p5/boolean">boolean</a>. |
94 | 64 | * |
95 | 65 | * From <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators">the MDN entry</a>: |
96 | 66 | * The non-identity operator returns true if the operands are not equal and/or not of the same type. |
97 | 67 | * |
| 68 | + * Note: In some examples around the web you may see a double-equals-sign |
| 69 | + * <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators#Equality">==</a>, |
| 70 | + * used for comparison instead. This is the non-strict equality operator in Javascript. |
| 71 | + * This will convert the two values being compared to the same type before comparing them. |
| 72 | + * |
98 | 73 | * @property === |
99 | 74 | * |
100 | 75 | * @example |
|
0 commit comments