You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/09-comparison/article.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,6 +140,25 @@ alert( 0 === false ); // false, കാരണം വ്യത്യസ്ത ട
140
140
141
141
സ്ട്രിക്റ്റ് ഇക്വാലിറ്റി ഓപറേറ്റർ എഴുതാൻ കുറച്ചധികം ഉണ്ടെങ്കിലും അവ താരതമ്യങ്ങളെ കൂടുതൽ വ്യക്തമാക്കുകയും തെറ്റുകൾ സംഭവിക്കാനുളള സാധ്യത കുറയ്ക്കുകയും ചെയ്യുന്നു.
142
142
143
+
## nullഉം undefinedഉം താരതമ്യം ചെയ്യുമ്പോൾ
144
+
145
+
`null` ഉം `undefined` ഉം മറ്റു വാല്യുകളുമായി താരതമ്യം ചെയ്യുമ്പോൾ അപ്രതീക്ഷിതമായ പല സ്വഭാവങ്ങളും നമുക്ക് കാണാൻ സാധിക്കും.
146
+
147
+
സ്ട്രിക്റ്റ് ഇക്വാലിറ്റി ഓപറേറ്റർ `===` ഉപയോഗിക്കുമ്പോൾ
148
+
: വാല്യുകൾ വ്യത്യസ്തമാണ്, കാരണം ഇവ രണ്ടും വ്യത്യസ്ത വിഭാഗമാണ്(data type).
149
+
150
+
```js run
151
+
alert( null === undefined ); // false
152
+
```
153
+
നോൺ സ്ട്രിക്റ്റ് ഓപറേറ്റർ `==` ഉപയോഗിക്കുമ്പോൾ
154
+
: ഇവിടെ ഒരു പ്രത്യേക നിയമമുണ്ട്: `null`,`undefined` വാല്യുകൾ അവയെ പരസ്പരം പൂർണമാക്കുന്നു. അവ മറ്റൊരു വാല്യുവുമായും തുല്ല്യമാകുന്നില്ല.
155
+
156
+
```js run
157
+
alert( null == undefined ); // true
158
+
```
159
+
മറ്റു ഓപറേറ്ററുകൾ ഉപയോഗിക്കുമ്പോൾ `< > <= >=`
160
+
: `null` ഉം `undefined` ഉം നമ്പറിലേക്ക് മാറ്റപ്പെടുന്നു: `null``0` ആയും, `undefined``NaN` ആയും മാറുന്നു.
161
+
ഇനി നമുക്ക് ഈ നിയമങ്ങൾ ഉപയോഗിച്ചാൽ സംഭവിക്കുന്ന ചില രസകരമായ കാര്യങ്ങൾ കാണാം. അതിലും പ്രധാനമായി എങ്ങനെ ഇത്തരം കെണികളിൽ വീഴാതെ നോക്കാം എന്നും.
143
162
## സംഗ്രഹം
144
163
145
164
- താരതമ്യ ഓപറേറ്ററുകൾ ഒരു ബൂലിയൻ വാല്യു (`true` or `false`) പുറത്ത് വിടുന്നു (റിട്ടേൺ ചെയ്യുന്നു).
0 commit comments