{"id":423,"date":"2014-09-25T16:43:05","date_gmt":"2014-09-26T00:43:05","guid":{"rendered":"http:\/\/www.tech.dimprash.com\/?p=423"},"modified":"2014-09-25T18:04:28","modified_gmt":"2014-09-26T02:04:28","slug":"language-comparision","status":"publish","type":"post","link":"http:\/\/www.tech.dimprash.com\/?p=423","title":{"rendered":"Language Comparision"},"content":{"rendered":"<p><strong>Variables<\/strong><\/p>\n<p>JS<br \/>\nvar colors = &#8220;green&#8221;; <\/p>\n<p>PHP<br \/>\n$colors = &#8220;green&#8221;;<\/p>\n<p>==========================================<br \/>\n<strong>Array<\/strong><\/p>\n<p>JS<br \/>\nvar colors ;<br \/>\ncolors = [&#8216;white&#8217;,&#8217;black&#8217;,&#8217;brown&#8217;];<br \/>\ncolors[0];<\/p>\n<p>OR <\/p>\n<p>var colors = Array(&#8216;white&#8217;,&#8217;black&#8217;,&#8217;brown&#8217;);<br \/>\ncolors.item(0); <\/p>\n<p>==========================================<br \/>\n<strong>Object<\/strong><\/p>\n<p>JS:<br \/>\nvar hotel = {<br \/>\n     name: &#8216;Super8&#8217;,<br \/>\n     rooms: 40,<br \/>\n     booked: 25<\/p>\n<p>     checkAvailability = function(){<br \/>\n         return this.rooms &#8211; this.booked;<br \/>\n     } <\/p>\n<p>};<\/p>\n<p>var hotelName = hotel.name;<br \/>\nvar roomsFree = hotel.checkAvailability(); <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Variables JS var colors = &#8220;green&#8221;; PHP $colors = &#8220;green&#8221;; ========================================== Array JS var colors ; colors = [&#8216;white&#8217;,&#8217;black&#8217;,&#8217;brown&#8217;]; colors[0]; OR var colors = Array(&#8216;white&#8217;,&#8217;black&#8217;,&#8217;brown&#8217;); colors.item(0); ========================================== Object JS: var hotel = { name: &#8216;Super8&#8217;, rooms: 40, booked: 25 checkAvailability = function(){ return this.rooms &#8211; this.booked; } }; var hotelName = hotel.name; var roomsFree = &hellip; <a href=\"http:\/\/www.tech.dimprash.com\/?p=423\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Language Comparision<\/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":[1],"tags":[],"class_list":["post-423","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=423"}],"version-history":[{"count":5,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/423\/revisions"}],"predecessor-version":[{"id":429,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=\/wp\/v2\/posts\/423\/revisions\/429"}],"wp:attachment":[{"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=423"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.tech.dimprash.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}