Tuesday, October 21, 2008

Javascript: the good parts - CTO Yahoo - part 2

note, try not to ever use ==, use === instead

value == null should be value === undefined

Good features
  • Obj can inherir from other objs
  • Func can be members of objs
  • for..in statement
every for..in statement needs to have an if statement to filter the items down

binary floating point numbers are not accurate, so if dealing with money for instance, take a dollar, x 100, do the math needed, then /100 to get your answer

Good parts:
  • lambda: functions as first class values, creating functions, passing them into other functions, etc...
  • Dynamic Objects
  • Loose Typing - don't have to set a type for every parameter (most languages use strong type)

No comments: