{"id":947,"date":"2012-03-18T15:41:18","date_gmt":"2012-03-18T21:41:18","guid":{"rendered":"http:\/\/bateru.com\/news\/?p=947"},"modified":"2012-03-18T16:01:15","modified_gmt":"2012-03-18T22:01:15","slug":"js2coffee-org-helps-your-learn-coffeescript-faster","status":"publish","type":"post","link":"https:\/\/bateru.com\/news\/2012\/03\/js2coffee-org-helps-your-learn-coffeescript-faster\/","title":{"rendered":"js2coffee.org helps your learn coffeescript faster"},"content":{"rendered":"<p><div class=\"imagecaptioneasy imagecaptioneasy_top_nowrap\" style=\"width:200px;\"><img decoding=\"async\" src=\"http:\/\/d2o0t5hpnwv4c1.cloudfront.net\/879_coffeeScript\/preview.png\" alt=\"coffeescript icon\"\/><br style=\"clear:both\" \/><span>coffeescript icon<\/span><\/div><br \/>\nCoffee-script is a smoking hot simple language that converts 100% into Javascript code. Coffee-script allows you to spend more time focusing on the algorithm rather than the syntax.<br \/>\n<a href=\"js2coffee.org\">js2coffee.org<\/a> is an awesome website that converts your Coffee-script to Javascript and vice versa on the fly. So you can learn Coffee-script faster.<br \/>\nExample:<br \/>\nLet&#8217;s convert my Random Number Generator code from a <a href=\"http:\/\/bateru.com\/news\/2011\/03\/code-of-the-day-Javascript-random-number-generator\/\">previous post<\/a> to Coffee-script.<br \/>\n<code><\/p>\n<pre lang='Javascript'>\r\n\/\/ Javascript version\r\nvar getRandomNum = function( i, decLen ){\r\n\treturn (Math.random() * (i||1) ).toFixed(decLen);\r\n};\r\n<\/pre>\n<p><\/code><\/p>\n<p><code><\/p>\n<pre lang='ruby'>\r\n# My Coffee-script version\r\ngetRandomNum = ( i=1, decLen ) -> (Math.random()*i).toFixed(decLen)\r\n<\/pre>\n<p><\/code><\/p>\n<p><code><\/p>\n<pre lang='ruby'>\r\n# js2coffee.org Coffee-script verison\r\ngetRandomNum = (i, decLen) ->\r\n\t(Math.random() * (i or 1)).toFixed decLen\r\n<\/pre>\n<p><\/code><\/p>\n<p>Awesome huh?<\/p>\n<p>Check out a <a href=\"http:\/\/jsbin.com\/evuquw\/edit#javascript,html\">demo of Coffeescript here<\/a>.<\/p>\n<p>I&#8217;ll like to leave you with a HTML5 <a href=\"http:\/\/bateru.com\/news\/2012\/03\/check-out-this-awesome-Coffee-script-tutorial\/\">Coffee-script presentation<\/a>.<\/p>\n<p>Cheers.<a href=\"http:\/\/bateru.com\/news\/wp-content\/uploads\/2012\/03\/js2coffee.org_.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bateru.com\/news\/wp-content\/uploads\/2012\/03\/js2coffee.org_.jpg\" alt=\"\" title=\"js2coffee.org\" width=\"991\" height=\"316\" class=\"aligncenter size-full wp-image-958\" srcset=\"https:\/\/bateru.com\/news\/wp-content\/uploads\/2012\/03\/js2coffee.org_.jpg 991w, https:\/\/bateru.com\/news\/wp-content\/uploads\/2012\/03\/js2coffee.org_-300x95.jpg 300w\" sizes=\"auto, (max-width: 991px) 100vw, 991px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>coffeescript icon Coffee-script is a smoking hot simple language that converts 100% into Javascript code. Coffee-script allows you to spend more time focusing on the algorithm rather than the syntax. js2coffee.org is an awesome website that converts your Coffee-script to Javascript and vice versa on the fly. So you can learn Coffee-script faster. Example: Let&#8217;s &hellip; <a href=\"https:\/\/bateru.com\/news\/2012\/03\/js2coffee-org-helps-your-learn-coffeescript-faster\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">js2coffee.org helps your learn coffeescript faster<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59,11,10],"tags":[117,164,16],"class_list":["post-947","post","type-post","status-publish","format-standard","hentry","category-entertainment","category-frontend-tech","category-tutorials","tag-coffeescript","tag-javascript","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/comments?post=947"}],"version-history":[{"count":5,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/947\/revisions"}],"predecessor-version":[{"id":955,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/posts\/947\/revisions\/955"}],"wp:attachment":[{"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/media?parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/categories?post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bateru.com\/news\/wp-json\/wp\/v2\/tags?post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}