The Weird Parts of JavaScript

preview_player
Показать описание
In this video we cover some of the oddest, most unexpected behavior in JavaScript. We'll read the spec, dive deep into how floating point numbers are stored, and take apart the abstract equality operator.

Рекомендации по теме
Комментарии
Автор

Any function well be work with a number, just make two points.
like this : 10..toFixed(x)
because the first point is not to reference, for the dozens, like 10.2 or 10.1

ennakrbouchaib
Автор

Thank for your amazing and passionate work this kind of topic is truly interesting... I am wondering if you plan on doing something about back end like NodeJS one day soon

Luxcium
Автор

I know nothing about him, but i'm just being nice, had me spitting my coffe :P

Nicoarielpkr
Автор

I am glad you have posted a video. I have really missed you.

yuhceeofficial
Автор

I thought I knew most of the weird things of JS, but this video just showed that there's more!

BrokoIis
Автор

Great video! However the problem with a newline after the return keyword is unaffected by the recommendation to "always use semicolons". Even if you write your semicolons, undefined will be returned. The only way to avoid it is to learn to not put return on its own line, and that has nothing to do with semicolons.

martinkrisell
Автор

Lol.. supervisor chose JS (node) for our project because it's event driven and non I/O blocking, then proceeded to tell us to explicitly use it in a sync manner whilst using external libraries... imagine trying to use an environment and eco system based on async in a synchronized manner.. it's crazy.

AAA-bouo
Автор

Hi, colt can you do a vidio on css grid, would be really helpful

intisark
Автор

Hello bro i recently brought your web development boot camp course it was awesome 👍
Thx for your effort

AJQuickShow
Автор

12:20 you said it represents infinity if it has all zeroes, but it's actually ones, and it says so right there on screen as well

danielzaiser
Автор

I can at least speak to NaN !== NaN. Essentially, it is _intended_ to make your code fail fast and hard, so that you know as soon as possible during execution that some calculation you did gave you a number that wasn’t a number. On top of that, all operations where an operand is NaN will result in NaN as well, and all comparisons against NaN return false, again in an attempt to protect you from utilizing that value somewhere where it could break something.

TyDurr
Автор

Got a headache now :) Thanks for the fun video :)

surjagain
Автор

3:30, I believe this is cause putting a ‘.’ by a int literal makes js think you’re trying to make a float

jadedansk
Автор

I think it might help others. This same method describes the areay problem in video too!

harshpatel
Автор

JavaScript designers: “hmmm, how can we break the rule of least astonishment……as much as possible? Let start by making true == false‼️”

SentimentalMo
Автор

Do a video explaining how javascript runs its program, closures and the event loop. That is, what actually happens behind the scenes when you run your code. Thanks

yuhceeofficial
Автор

1.toFixed(1) is not unexcpected since js wants a floating point number. Just write 1..toFixed(1)

ismaelgoldsteck
Автор

I am truly against this automatic semi-colon insertion. Ok, some may consider it convenient. But it prevents many ways of formatting your code. I always like to put my braces on new lines but there are many situations where this can't be done in JS like you showed with the return statement.

MaxPicAxe
Автор

It's much easier to learn rules of omitting semicolons and make prettier format it in a way you need automagicaly (either with or without, depending on the standard you use)

sobanya_
Автор

The only time I use == is to treat null and undefined as the same thing.

puppycam
visit shbcf.ru