"" == "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
?. 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.
Personally I think that 2015 is the year of databases anywhere, in special in the client side with projects very interesting as PouchDB or MeteorJS.
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.
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?)
Recently @rcsole_ show me the power of levelDB. At this moment @substack is writting a little book, but still needs some time to get ready.
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.
For know more the level project I recommend read this series of post in DailyJS written by the author of some level repositories, @rvagg.
About this , Rocksdb is the Facebook version built using LevelDB and exists a fork called level-rocksdb for use it.
Alternatively another key value database in momoery is LokiJS.