I am just completing the final day of some rather good Windows 8 Metro App developer training. 90% of the time we have been using JavaScript.JavaScript has many “omg” moments when compared to trusty C#. Which is why it has been very handy to have Mike T sitting next to me. If you find yourself “without Mike” (as I will next week), then I would recommend you take a look at his series of OMG posts!
- Semi colons are optional
- Type system
- underflow/overflow/Divide by Zero
- Regular Expressions are built in
- Truth and Falsy – true unless one of undefined, null, 0, –0, Nan, “”
- Global variables live on a global object
- Expando objects
- Wrappers
- Type conversions
- Object to primitive conversions
- Variable Scope – no scope blocks, can use before declare
- Bitwise operators – avoid
- Equality and Strict Equality – === and !==
- “use strict” – use it!
- Magic of short-circuiting ANDs and Truthy/Falssy
- Optional Function Arguments
- Nested Functions
- Arrays vs Lists
- Function Invocation Context and Strict Mode
- Nested functions and Invocation Context
- Everything is a function
- array.sort won’t sort numbers correctly
- parseInt() needs help
- Callbacks and scope
- Function Literals create functions
- Partial Application and Mapping
- Self Defining Functions
- This or That
- Events
- And finally… “It’s just like everywhere”
OMG