Comparison of datatypes in javascript | chai aur #javascript

preview_player
Показать описание
share krdo linkedin pe
Рекомендации по теме
Комментарии
Автор

best javascript course exact point on point teaching without overexplanation, great sir I loved your way of teaching Thanks for such a valuable course

skill.spirit
Автор

Type Conversion:-


> from to Numbers:
"33" => 33
"33abc" => NaN
true => 1; false => 0


> from to Boolean:
1 => true; 0 => false;
NaN => false;
"" => false;
"hitesh" => true;


>convert during operations
=>if string is written first then convert all after it to string:
"2" + 2 + 2 = 222
"1" + 2 = 12
=>if string comes after then the conversion occurs at last
2 + 2 + "2" = 42
1 + 1 + "2" + 2 + 1 = 2221


#use +operand to convert the operand to number

elyramzan
Автор

I always got confused about javascript comparison results but I am now clear about the comparison and equality operators. Thank you for this type of valuable course.

Jai-xqhi
Автор

संगणक की भाषा में अच्छी पकड़ और समझाने के तरीके से हम बहुत खुश हुए और हमें बहुत मजा आया

Sapien_
Автор

Best javascript course I have ever learn from . Very nice and undoubtful explanation 👌👍

vaishnavikumbhakarna
Автор

best javascript course exact point on point teaching without overexplanation, great sir I loved your way of teaching Thanks for such a valuable course

engineeryt
Автор

The reason is that an equality check == and comparisons > < >= <= work differently. Comparisons convert null to a number, treating it as 0. That’s why (3) null >= 0 is true and (1) null > 0 is false.

On the other hand, the equality check == for undefined and null is defined such that, without any conversions, they equal each other and don’t equal anything else. That’s why (2) null == 0 is false.

null is treated in a special way by the Equals Operator (==). In a brief, it only coerces to undefined:

null == null; // true
null == undefined; // true
Value such as false, '', '0', and [] are subject to numeric type coercion, all of them coerce to zero.

ambaradhikari
Автор

for those who are still confused:

1.console.log(null > 0); // false
Comparison (>) converts null to a number before comparing.

null is converted to 0.

0 > 0 is false.

2. console.log(null == 0); // false
The equality check (==) does not convert null to a number.

null is only equal to undefined in loose equality (==), not to numbers.

So, null == 0 is false.

3. console.log(null >= 0); // true
The >= comparison also converts null to a number (0).

It becomes 0 >= 0, which is true.

ziaa
Автор

Outstanding series I ever came across... Learning is not hard but use simple banane wala hona chaiye..❤.

Jdk
Автор

00:02 Comparison of datatypes in JavaScript
01:10 Comparing data types in JavaScript
02:19 When comparing values in JavaScript, make sure their data types are the same.
03:27 The comparison and equality operators in JavaScript have different behaviors.
04:36 JavaScript converts null to zero during comparison.
05:44 Comparison and equality checks in JavaScript
06:53 JavaScript datatype comparison with double and triple equal
07:50 Avoid confusing conversions and comparisons in JavaScript

ayush.tiwarios
Автор

"I owe my JavaScript skills to Chai aur Code. Brilliant content and exceptional guidance!"

BitFire
Автор

real king sir hitesh,
teaching kay asal meaning ko pura krty hvay

tech_channel
Автор

Such an amazing course sir.!
lots of love from Pakistan💕

MemonALi
Автор

Best channel for js ..I share ur channel with all my friends

Prernachaturvedi
Автор

In JavaScript, the correct way to check if a value is NaN is by using the Number.isNaN() function, rather than using the equality check

amankishore
Автор

No words for this extra ordinary explanation.

Instrumentation
Автор

best Series ALL OVER UNIVERSE, thank you Sir 🙏

RagSingh-ee
Автор

"Hey Chai or Code and Hitesh Choudhary, I'm on the edge of my seat in anticipation for the backend full series and DSA series on this channel! ☕💻 Your content is like the perfect blend of coding wisdom and the soothing essence of chai, and I can't wait to dive deep into these topics with your expert guidance. Keep brewing up those fantastic tutorials, and I'll keep sipping and coding along! 🚀🔥"

sachinxblock
Автор

Bro this is Really paid leave course

I have already watched JavaScript tutorial on a other channel. But I made to much mistakes in JavaScript. After watching your course I can understand JavaScript easy. Your Way of Teaching is Amazing. You teach Everything perfectly. Thanks for your effort

Big fan from Pakistan ❤❤❤❤❤❤❤

AnwarHussain-hrlm
Автор

I never tried these things, Feeling awesome after learn these comparison....

pranjalgogoigaming-
welcome to shbcf.ru