{"id":2662,"date":"2017-06-25T00:04:19","date_gmt":"2017-06-24T18:34:19","guid":{"rendered":"https:\/\/code4developers.com\/?p=2662"},"modified":"2018-04-10T19:34:54","modified_gmt":"2018-04-10T14:04:54","slug":"ecmascript-5-strict-mode-json","status":"publish","type":"post","link":"https:\/\/code4developers.com\/ecmascript-5-strict-mode-json\/","title":{"rendered":"ECMAScript5 Strict Mode, JSON, and More&#8230;."},"content":{"rendered":"<h2 id=\"introduction\"><strong>Introduction<\/strong><\/h2>\n<p>There are a number of other new features and APIs that need attention, as well. The largest of which are\u00a0<strong>Strict Mode<\/strong>\u00a0and native\u00a0<strong>JSON<\/strong>\u00a0support.<\/p>\n<h3 id=\"strict-mode\"><strong>Strict Mode<\/strong><\/h3>\n<p>Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a \u201cstrict\u201d operating context. This strict context prevents certain actions from being taken and throws more exceptions (generally providing the user with more information and a tapered-down coding experience).<!--more--><\/p>\n<p>Since ECMAScript 5 is backwards-compatible with ECMAScript 3, all of the \u201cfeatures\u201d that were in ECMAScript 3 that were \u201cdeprecated\u201d are just disabled (or throw errors) in strict mode, instead.<\/p>\n<p>Strict mode helps out in a couple ways:<\/p>\n<ul>\n<li>It catches some common coding bloopers, throwing exceptions.<\/li>\n<li>It prevents, or throws errors, when relatively \u201cunsafe\u201d actions are taken (such as gaining access to the global object).<\/li>\n<li>It disables features that are confusing or poorly thought out.<\/li>\n<\/ul>\n<p>Most of the information about strict mode can be found in the\u00a0<a href=\"http:\/\/www.ecma-international.org\/publications\/files\/ECMA-ST\/ECMA-262.pdf\" target=\"_blank\" rel=\"noopener\">ES5 specification [PDF]<\/a>\u00a0on page #235.<\/p>\n<p>It should be noted that ECMAScript 5\u2019s strict mode is different from the strict mode available in Firefox (which can be turned on by going to about:config and enabled javascript.options.strict). ES5\u2019s strict mode complains about a completely different set of potential errors (whereas Firefox\u2019s existing strict mode tries to enforce some good practices, only).<\/p>\n<h4 id=\"how-do-you-enable-strict-mode\"><strong>How do you enable strict mode?<\/strong><\/h4>\n<p>Simple. Toss this at the top of a program to enable it for the whole script:<\/p>\n<pre class=\"theme:xcode lang:js decode:true\">\"use strict\";<\/pre>\n<p>Or place it within a function to turn on strict mode only within that context.<\/p>\n<pre class=\"theme:xcode lang:js decode:true\">function imStrict(){\r\n\r\n\"use strict\";\r\n\r\n\/\/ ... your code ...\r\n\r\n}<\/pre>\n<p>Note the syntax that\u2019s used to enable strict mode (I love this!). It\u2019s simply a string in a single statement that happens to contain the contents \u201cuse strict\u201d.\u00a0<em>No new syntax is introduced in order to enable strict mode.<\/em>\u00a0This is huge. This means that you can turn strict mode on in your scripts \u2013 today \u2013 and it\u2019ll have, at worst, no side effect in old browsers.<\/p>\n<p>As you may note from the examples here and ECMAScript4 there are virtually no new syntax additions or changes to the language in ECMAScript 5. This means that you can write your ES5 scripts in a manner that will be able to gracefully degrade for older useragents \u2013 something that wasn\u2019t possible with ECMAScript 4. The way in which strict mode is enabled is a great illustration of that point in practice.<\/p>\n<p>A neat aspect of being able to define strict mode within a function is that you can now define complete JavaScript libraries in a strict manner without affecting outside code.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">\/\/ Non-strict code...\r\n(function(){\r\n\"use strict\";\r\n\r\n\/\/ Define your library strictly...\r\n})();\r\n\/\/ Non-strict code...<\/pre>\n<p>A number of libraries already use the above technique (wrapping the whole library with an anonymous self-executing function) and they will be able to take advantage of strict mode very easily.<\/p>\n<p>So what changes when you put a script into strict mode? A number of things.<\/p>\n<h4 id=\"variables-and-properties\"><strong>Variables and Properties<\/strong><\/h4>\n<p>An attempt to assign\u00a0foo = &#8220;bar&#8221;;\u00a0where \u2018foo\u2019 hasn\u2019t been defined will fail. Previously it would assign the value to the foo property of the global object (e.g.\u00a0window.foo), now it just throws an exception. This is definitely going to catch some annoying bugs.<\/p>\n<p>Any attempts to write to a property whose writable attribute is set to false, delete a property whose configurable attribute is set to false, or add a property to an object whose extensible attribute is set to false will result in an error. Traditionally no error will be thrown when any of these actions are attempted, it will just fail silently.<\/p>\n<p>Deleting a variable, a function, or an argument will result in an error.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">var foo = \"test\";\r\nfunction test(){}\r\n\r\ndelete foo; \/\/ Error\r\n\r\ndelete test; \/\/ Error\r\n\r\nfunction test2(arg) {\r\ndelete arg; \/\/ Error\r\n}<\/pre>\n<p>Defining a property more than once in an object literal will cause an exception to be thrown<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">\/\/ Error\r\n{ foo: true, foo: false }<\/pre>\n<h4 id=\"eval\"><strong>eval<\/strong><\/h4>\n<p>Virtually any attempt to use the name \u2018eval\u2019 is prohibited \u2013 as is the ability to assign the eval function to a variable or a property of an object.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">\/\/ All generate errors...\r\n\r\nobj.eval = ...\r\n\r\nobj.foo = eval;\r\n\r\nvar eval = ...;\r\n\r\nfor ( var eval in ... ) {}\r\n\r\nfunction eval(){}\r\n\r\nfunction test(eval){}\r\n\r\nfunction(eval){}\r\n\r\nnew Function(\"eval\")<\/pre>\n<p>Additionally, attempts to introduce new variables through an eval will be blocked.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">eval(\"var a = false;\");\r\n\r\nprint( typeof a ); \/\/ undefined<\/pre>\n<h4 id=\"functions\"><strong>Functions<\/strong><\/h4>\n<p>Attempting to overwrite the arguments object will result in an error:<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">arguments = [...]; \/\/ not allowed<\/pre>\n<p>Defining identically-named arguments will result in an error\u00a0function( foo, foo ) {}.<\/p>\n<p>Access to\u00a0arguments.caller\u00a0and\u00a0arguments.callee\u00a0now throw an exception. Thus any anonymous functions that you want to reference will need to be named, like so:<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">setTimeout(function later(){\r\n\/\/ do stuff...\r\nsetTimeout( later, 1000 );\r\n}, 1000 );<\/pre>\n<p>The\u00a0arguments\u00a0and\u00a0caller\u00a0properties of other functions no longer exist \u2013 and the ability to define them is prohibited.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">function test(){\r\n  function inner(){\r\n      \/\/ Don't exist, either\r\n      test.arguments = ...; \/\/ Error\r\n      inner.caller = ...; \/\/ Error\r\n  }\r\n}<\/pre>\n<p>Finally, a long-standing (and very annoying) bug has been resolved: Cases where null or undefined is coerced into becoming the global object. Strict mode now prevents this from happening and throws an exception instead.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">(function(){ ... }).call( null ); \/\/ Exception<\/pre>\n<h4 id=\"with\"><strong>with(){}<\/strong><\/h4>\n<p>with(){}\u00a0statements are dead when strict mode is enabled \u2013 in fact it even appears as a syntax error. While the feature was certainly mis-understood and possibly mis-used I\u2019m not convinced that it\u2019s enough to be stricken from the record.<\/p>\n<p>The changes made in ECMAScript 5 strict mode are certainly varied (ranging from imposing stylistic preferences, like removing with statements, to fixing legitimately bad language bugs, like the ability to redefine properties in object literals). It\u2019ll be interesting to see how people begin to adopt these points and how it\u2019ll change JavaScript development.<\/p>\n<p>All that being said, I\u2019m fairly certain that jQuery is ES5-Strict compatible right now. Once an implementation of the language is made available (so that that premise may be tested) I\u2019ll happily switch jQuery over to working exclusively in strict mode.<\/p>\n<h3 id=\"json\"><strong>JSON<\/strong><\/h3>\n<p>The second major feature of the language is the addition of native JSON support to the language.<\/p>\n<p>I\u2019ve been\u00a0championing\u00a0this move for a\u00a0long time\u00a0and I\u2019m glad to see it finally arrive in a specification.<\/p>\n<p>In the meantime PLEASE start migrating your JSON-using applications over to Crockford\u2019s\u00a0json2.js. It is fully compatible with the ECMAScript 5 specification and gracefully degrades if a native (faster!) implementation exists.<\/p>\n<p>In fact, I\u00a0just landed\u00a0a change in jQuery yesterday that utilizes the\u00a0JSON.parse\u00a0method if it exists, now that it has been completely specified.<\/p>\n<p>There are two primary methods for handling JSON:\u00a0JSON.parse\u00a0(which converts a JSON string into a JavaScript object) and\u00a0JSON.stringify\u00a0(which convert a JavaScript object into a serialized string).<\/p>\n<h4 id=\"json-parse-text\"><strong>JSON.parse( text )<\/strong><\/h4>\n<p>Converts a serialized JSON string into a JavaScript object.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">var obj = JSON.parse('{\"name\":\"John\"}');\r\n\r\n\/\/ Prints 'John'\r\n\r\nprint( obj.name );\r\nJSON.parse( text, translate )<\/pre>\n<p>Use a translation function to convert values or remove them entirely.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">function translate(key, value) {\r\n  if ( key === \"name\" ) {\r\n       return value + \" Resig\";\r\n  }\r\n}\r\nvar obj = JSON.parse('{\"name\":\"John\",\"last\":\"Resig\"}', translate);\r\n\/\/ Prints 'John Resig'\r\nprint( obj.name );\r\n\/\/ Undefined\r\nprint( obj.last );<\/pre>\n<h4 id=\"json-stringify-obj\"><strong>JSON.stringify( obj )<\/strong><\/h4>\n<p>Convert an object into a serialized JSON string.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">var str = JSON.stringify({ name: \"John\" });\r\n\/\/ Prints {\"name\":\"John\"}\r\nprint( str );\r\n\r\nJSON.stringify( obj, [\"white\", \"list\"])\r\n\r\nSerialize only a specific white list of properties.\r\nvar list = [\"name\"];\r\n\r\nvar str = JSON.stringify({name: \"John\", last: \"Resig\"}, list);\r\n\/\/ Prints {\"name\":\"John\"}\r\nprint( str );\r\n\r\n\r\nJSON.stringify( obj, translate )\r\n\r\nSerializes the object using a translation function.\r\nfunction translate(key, value) {\r\n   if ( key === \"name\" ) {\r\n       return value + \" Resig\";\r\n   }\r\n}\r\nvar str = JSON.stringify({\"name\":\"John\",\"last\":\"Resig\"}, translate);\r\n\/\/ Prints {\"name\":\"John Resig\"}\r\nprint( str );\r\n\r\nJSON.stringify( obj, null, 2 )\r\n\r\nAdds the specified number of spaces to the output, printing it evenly.\r\nvar str = JSON.stringify({ name: \"John\" }, null, 2);\r\n\r\n\/\/ Prints:\r\n\/\/ {\r\n\/\/&amp;nbsp;&amp;nbsp; \"name\": \"John\"\r\n\/\/ }\r\nprint( str );\r\nJSON.stringify( obj, null, \"\\t\" )\r\n\r\nUses the specified string to do the spacing.\r\nvar str = JSON.stringify({ name: \"John\" }, null, \"\\t\");\r\n\r\n\/\/ Prints:\r\n\/\/ {\\n\\t\"name\": \"John\"\\n}\r\nprint( str );<\/pre>\n<p>Additionally, a few new generic methods have been added to some of the base objects but, frankly, they aren\u2019t that interesting. The results from String, Boolean, and Number are just equivalent to calling\u00a0.valueOf()\u00a0and the result from Date is equivalent to calling\u00a0.toISOString()<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">\/\/ Yawn...\r\n\r\nString.prototype.toJSON\r\nBoolean.prototype.toJSON\r\nNumber.prototype.toJSON\r\nDate.prototype.toJSON<\/pre>\n<h3 id=\"bind\"><strong>.bind()<\/strong><\/h3>\n<p>A welcomed addition to the language is a built-in\u00a0.bind()\u00a0method for enforcing the context of a function (virtually identical to\u00a0Prototype\u2019s .bind implementation).<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">Function.prototype.bind(thisArg, arg1, arg2....)<\/pre>\n<p>Enforces the \u2018this\u2019 of the specified function to a specific object \u2013 and passing in any specified arguments.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">var obj = {\r\n   method: function(name){\r\n       this.name = name;\r\n   }\r\n};\r\nsetTimeout( obj.method.bind(obj, \"John\"), 100 );<\/pre>\n<p>Considering how long this function (and its equivalents) have been around it\u2019s a welcome addition to the language.<\/p>\n<h3 id=\"date\"><strong>Date<\/strong><\/h3>\n<p>Dates are now capable of both parsing and outputting ISO-formatted dates. Thank goodness, about time.<\/p>\n<p>It now attempts to parse the date as if it was ISO-formatted, first, then moves on to the other inputs that it accepts.<\/p>\n<p>Additionally, date objects now have a new\u00a0.toISOString()\u00a0method that outputs the date in an ISO format.<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">var date = new Date(\"2009-05-21T16:06:05.000Z\");\r\n\r\n\/\/ Prints 2009-05-21T16:06:05.000Z\r\nprint( date.toISOString() );<\/pre>\n<h3 id=\"trim\"><strong>.trim()<\/strong><\/h3>\n<p>A native, built-in,\u00a0.trim()\u00a0is now included for strings which works identically to all the other trim methods out there \u2013 with the potential to possibly work faster.<\/p>\n<h3 id=\"array\"><strong>Array<\/strong><\/h3>\n<p>The\u00a0<a href=\"https:\/\/developer.mozilla.org\/en\/New_in_JavaScript_1.6#Array_extras\" target=\"_blank\" rel=\"noopener\">JavaScript Array Extras<\/a>\u00a0that\u2019ve been around for, what seems like, forever are finally formally specified. This includes the following methods: indexOf, lastIndexOf, every, some, forEach, map, filter, reduce, and reduceRight.<\/p>\n<p>Additionally a new\u00a0Array.isArray\u00a0method is included, providing functionality very similar to the following:<\/p>\n<pre class=\"theme:xcode lang:default decode:true\">Array.isArray = function( array ) {\r\n     return Object.prototype.toString.call( array ) === \"[object Array]\";\r\n};<\/pre>\n<h2 id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n<p>Altogether I think ECMAScript5 makes for an interesting package. It isn\u2019t the massive leap that ECMAScript 4 promised but it is a series of respectable improvements that reduces the number of obvious bugs while making the language safer and faster.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction There are a number of other new features and APIs that need attention, as well. The largest of which are\u00a0Strict Mode\u00a0and native\u00a0JSON\u00a0support. Strict Mode Strict Mode is a new&hellip;<\/p>\n","protected":false},"author":7,"featured_media":3127,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[22],"powerkit_post_featured":[],"class_list":{"0":"post-2662","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-javascript","8":"tag-javascript"},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8NAi4-GW","jetpack-related-posts":[{"id":3119,"url":"https:\/\/code4developers.com\/difference-between-javascript-and-ecmascript\/","url_meta":{"origin":2662,"position":0},"title":"What\u2019s the difference between JavaScript and ECMAScript?","author":"Arif Khoja","date":"October 31, 2017","format":false,"excerpt":"I\u2019ve tried googling \u201cthe difference between JavaScript and ECMAScript.\u201d I ended up having to wade through a sea of ambiguous and seemingly conflicting results: \u201cECMAScript is a standard.\u201d \u201cJavaScript is a standard.\u201d \u201cECMAScript is a specification.\u201d \u201cJavaScript is an implementation of the ECMAScript standard.\u201d \u201cECMAScript is standardized JavaScript.\u201d \u201cECMAScript is\u2026","rel":"","context":"In &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/code4developers.com\/category\/javascript\/"},"img":{"alt_text":"javascript","src":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3230,"url":"https:\/\/code4developers.com\/whats-new-ecmascript-2018\/","url_meta":{"origin":2662,"position":1},"title":"What\u2019s new in ECMAScript 2018","author":"Arif Khoja","date":"February 16, 2018","format":false,"excerpt":"Four new feature proposals for the specification underlying JavaScript are finalized and four others are under consideration ECMAScript, the standard specification underlying JavaScript, is on track for a new release, likely in June. So far, four proposals have been finalized for inclusion in the ECMAScript 2018 specification, said Zibi Braniecki,\u2026","rel":"","context":"In &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/code4developers.com\/category\/javascript\/"},"img":{"alt_text":"ecma script","src":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/ecma.png?fit=400%2C277&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9279,"url":"https:\/\/code4developers.com\/what-is-new-in-angular-10\/","url_meta":{"origin":2662,"position":2},"title":"What is new in Angular 10?","author":"Yatendrasinh Joddha","date":"June 25, 2020","format":false,"excerpt":"Today Angular Teams has announced Version 10.0.0 of Angular! This release is smaller than typical, but it covers the entire platform, including the framework, Angular Material, and the CLI. What's new here? Optional Stricter Settings ng new --strict Enabling this flag initializes your new project with a few new settings\u2026","rel":"","context":"In &quot;Angular&quot;","block_context":{"text":"Angular","link":"https:\/\/code4developers.com\/category\/angular\/"},"img":{"alt_text":"","src":"https:\/\/miro.medium.com\/max\/60\/0*ruU5G-8_hqEp3UBY?q=20","width":350,"height":200},"classes":[]},{"id":3321,"url":"https:\/\/code4developers.com\/spread-syntax-in-javascript\/","url_meta":{"origin":2662,"position":3},"title":"Spread syntax (three dots) in JavaScript","author":"Yatendrasinh Joddha","date":"March 21, 2018","format":false,"excerpt":"Spread syntax which is used by typing three dots (...) in JavaScript. It allows an array expression or string or anything which can be iterating to be expanded in places where zero or more arguments for function calls\u00a0or elements for array are expected. It can also be used for an\u2026","rel":"","context":"In &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/code4developers.com\/category\/javascript\/"},"img":{"alt_text":"javascript","src":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3311,"url":"https:\/\/code4developers.com\/default-parameter-in-a-javascript-function\/","url_meta":{"origin":2662,"position":4},"title":"Default Parameter in JavaScript function","author":"Yatendrasinh Joddha","date":"March 17, 2018","format":false,"excerpt":"In any programming language we often require having default parameter or default value for the parameter in a function. JavaScript allow us to initialize parameter a default value. If you are not passing any value to the parameter, then the default value of the parameter will be undefined. Let's consider\u2026","rel":"","context":"In &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/code4developers.com\/category\/javascript\/"},"img":{"alt_text":"javascript","src":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":4103,"url":"https:\/\/code4developers.com\/top-array-hacks\/","url_meta":{"origin":2662,"position":5},"title":"Top Array Hacks","author":"Arif Khoja","date":"March 14, 2019","format":false,"excerpt":"Arrays are everywhere in JavaScript and with the new\u00a0spread operators\u00a0introduced in ECMAScript 6, you can do awesome things with them. In this post I will show you 3 useful tricks you can use when programming. 1. Iterating through an empty\u00a0array JavaScript arrays are sparse in nature in that there are\u2026","rel":"","context":"In &quot;JavaScript&quot;","block_context":{"text":"JavaScript","link":"https:\/\/code4developers.com\/category\/javascript\/"},"img":{"alt_text":"javascript","src":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/code4developers.com\/wp-content\/uploads\/2017\/10\/javascript.jpg?fit=750%2C422&ssl=1&resize=700%2C400 2x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/posts\/2662","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/comments?post=2662"}],"version-history":[{"count":8,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/posts\/2662\/revisions"}],"predecessor-version":[{"id":2673,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/posts\/2662\/revisions\/2673"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/media\/3127"}],"wp:attachment":[{"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/media?parent=2662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/categories?post=2662"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/tags?post=2662"},{"taxonomy":"powerkit_post_featured","embeddable":true,"href":"https:\/\/code4developers.com\/wp-json\/wp\/v2\/powerkit_post_featured?post=2662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}