Section 1

Preview this deck

A way to compare floating point numbers reliably

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (11)

Section 1

(11 cards)

A way to compare floating point numbers reliably

Front

Back

NaN === NaN

Front

False

Back

Benefits of "use strict"

Front

Easier debugging Prevention of accidental globals Eliminates "this" coercion Disallows duplicate parameter values Makes eval() safer Throws error on invalid usage of delete

Back

bar bar undefined bar

Front

Back

Pitfall for using "typeof bar === "object"" to determine if bar is an object?

Front

null is also considered an object use "bar != null" to avoid pitfall

Back

What is NaN's type?

Front

Number

Back

"this" coercion

Front

A this value of null or undefined is automatically coerced to the global

Back

Full proof way to detect NaN

Front

value !== value

Back

Significance and reason for wrapping entire content of JS source file in a function block

Front

Common practice by many popular JavaScrip libraries Creates closure around entire content of the file Creates private namespace avoiding potential name clashes between different modules and libraries Important when using jQuery to disable $ reference

Back

Returns undefined because ; is automatically inserted immediately after return statement

Front

Back

var a = b = 5

Front

shorthand for b = 5 var a = b

Back