"" == "0" // false 0 == "" // true 0 == "0" // true false == "false" // false false == "0" // true false == undefined // false false == null // false null == undefined // true " \t\r\n" == 0 // true
For reduce issues in CoffeeScript exists two helpers:
===operator is by default
- The Existential Operator
?. It is similar to Ruby operator and returns
trueunless a variable is
This is nice and is sugar for you, but warning with use existential operators with Boolean values:
isUserExist = false message = if isUserExist? then 'user exists!' else 'user doesn\'t exist!' console.log message # => "user exists!"
? operator only returns false with
Another example with
# ||= operator variable = false variable ||= 'value' variable # => 'value' # ?= operator variable2 = false variable2 ?= 'value' variable2 # => false
A very nice post by @addyosmani explaning some tips and orientations for the future of the web.
About ECMAScript 6 features is true that some features are now available, but still need too much effort to be consolidated in this new year.
Front-end Job Interview Questions
A fun and useful repository for measuring yourself about your knowledge in technologies in the frontend (and maybe as preparation for jobs interview!). Check it out in Github.
For a long time I am interested in have a code a little more functional approach.
If you are interested I recommend yout start with this awesome introductional video by @javiervelezreye (at this moment only available in spanish, sorry):
Definetely the right way to learn more about Functional Programming is try a pure functional language. ClojureScript is the language, and maybe for a first introduction Clojurescript Koans or modern-cljs may be appropriate (Yes, I still want to try, where is my time?)
Client, memory and Databases
Now the project is more big: levelUP is high level wrapper, but also exist levelDOWN, that is the part that speak with leveldb. This design allow you use other adapters as database. In definetely to use levelDB use level and level-browserify in the browser that have the last levelUP and levelDOWN stable version.
For me, the the jewel in the crown is levelgraph, that use levelDB as Graph Database.
Alternatively another key value database in momoery is LokiJS.