Comments about Eloquent JavaScript: chapters 2 and 3
Upcoming SlideShare
Loading in...5
×
 

Comments about Eloquent JavaScript: chapters 2 and 3

on

  • 802 views

Comments about Eloquent JavaScript: chapters 2 and 3

Comments about Eloquent JavaScript: chapters 2 and 3

Statistics

Views

Total Views
802
Views on SlideShare
799
Embed Views
3

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 3

http://www.linkedin.com 2
https://www.linkedin.com 1

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Comments about Eloquent JavaScript: chapters 2 and 3 Comments about Eloquent JavaScript: chapters 2 and 3 Presentation Transcript

  • Javascript Tricky stuffEloquent JavaScript - Chapters 2 and 3
  • Variables comparison• null == undefined• false == 0• “” == 0• “5” == 5• Use === or !==
  • Boolean expressions• 0, “”, null, undefined, NaN equiv. to false• anything else equiv. to true
  • Automatic type conversion• “patata”+5• null + “torious”• “4” * 4 --> Number(“4”) * 4• 4 * “patata”• typeof NaN ?• https://www.destroyallsoftware.com/talks/ wat
  • NaN• NaN == NaN ?• isNaN• isNaN(“3”) ?
  • && ||• var output = (input || “is input is false”)• var output = (input && “input is true”)• Evaluates the first part of the expression, the second part only if necessary
  • Scope of variables• Global• Local• var name OR name• Closure•
  • Efficiency• Recursion vs loops
  • Functions• Anonymous• Arguments variable