{"id":6226,"date":"2021-05-12T15:20:55","date_gmt":"2021-05-12T15:20:55","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=6226"},"modified":"2021-05-12T15:28:11","modified_gmt":"2021-05-12T15:28:11","slug":"javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/","title":{"rendered":"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">JavaScript is one of the most popular programming languages for web programming.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this article, we\u2019ll look at the basic syntax of modern JavaScript<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">JSON<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We can create JSON strings from JavaScript objects with the\u00a0<code>JSON.stringify<\/code>\u00a0method:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"323\" height=\"134\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-3.jpg\" alt=\"\" class=\"wp-image-6231\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-3.jpg 323w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-3-300x124.jpg 300w\" sizes=\"auto, (max-width: 323px) 100vw, 323px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">And we can convert JSON strings back to JavaScript objects with\u00a0<strong><code>JSON.parse<\/code>\u00a0:<\/strong><\/p>\n\n\n\nconst obj = JSON.parse(json);\n\n\n\n<p class=\"wp-block-paragraph\">We can use it to store data in local storage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We\u2019ve to convert objects into strings first to store them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To store objects we call\u00a0<strong><code>localStorage.setItem<\/code>\u00a0:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"365\" height=\"158\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-4.jpg\" alt=\"\" class=\"wp-image-6232\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-4.jpg 365w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-4-300x130.jpg 300w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The first argument is the key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And we can get data by their keys with\u00a0<strong><code>getItem<\/code>\u00a0:<\/strong><\/p>\n\n\n\nlocalStorage.getItem(&#8216;json&#8217;)\n\n\n\n<h3 class=\"wp-block-heading\">Loops<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">avaScript comes with various kinds of loops.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One kind of loop is the\u00a0<strong><code>for<\/code>\u00a0<\/strong>loop<strong>:<\/strong><\/p>\n\n\n\nfor (let i = 0; i < 10; i++) {\n  console.log(i);\n}\n\n\n\n<p class=\"wp-block-paragraph\">We can loop through any kind of iterable object with the\u00a0<code><strong>for-of<\/strong><\/code>\u00a0loop:<\/p>\n\n\n\nfor (let i of custOrder) {\n  console.log(i);\n}\n\n\n\n<p class=\"wp-block-paragraph\">Some iterable objects include arrays, strings, and node lists.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another kind of loop is the\u00a0<code><strong>while<\/strong><\/code>\u00a0loop:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"121\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-5.jpg\" alt=\"\" class=\"wp-image-6233\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There\u2019s also the\u00a0<code><strong>do-while<\/strong><\/code>\u00a0loop:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"281\" height=\"135\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-6.jpg\" alt=\"\" class=\"wp-image-6234\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<code><strong>break<\/strong><\/code>\u00a0keyword lets us end the loop early:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"340\" height=\"148\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-7.jpg\" alt=\"\" class=\"wp-image-6235\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-7.jpg 340w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-7-300x131.jpg 300w\" sizes=\"auto, (max-width: 340px) 100vw, 340px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The\u00a0<strong><code>continue<\/code>\u00a0<\/strong>keyword lets us skip to the next iteration:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"144\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-8.jpg\" alt=\"\" class=\"wp-image-6236\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-8.jpg 360w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-8-300x120.jpg 300w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Data Types<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript comes with various data types.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They include:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"538\" height=\"184\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-10.jpg\" alt=\"\" class=\"wp-image-6239\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-10.jpg 538w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-10-300x103.jpg 300w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Objects<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We can create an object with curly braces:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"461\" height=\"179\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-11.jpg\" alt=\"\" class=\"wp-image-6240\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-11.jpg 461w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-11-300x116.jpg 300w\" sizes=\"auto, (max-width: 461px) 100vw, 461px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">It has properties and methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>this<\/code>\u00a0<\/strong>is the\u00a0<code><strong>student<\/strong><\/code>\u00a0object itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can call\u00a0<code><strong>fullName<\/strong><\/code>\u00a0with\u00a0<strong><code>student.fullName()<\/code>\u00a0.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And we can assign values to properties with:<\/p>\n\n\n\nstudent.age = 19;\n\n\n\n<h3 class=\"wp-block-heading\">Promises<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We can create promises with the\u00a0<code><strong>Promise<\/strong><\/code>\u00a0constructor:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"605\" height=\"212\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-12.jpg\" alt=\"\" class=\"wp-image-6241\" srcset=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-12.jpg 605w, https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-12-300x105.jpg 300w\" sizes=\"auto, (max-width: 605px) 100vw, 605px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">We can\u00a0<strong><code>resolve<\/code>\u00a0<\/strong>to fulfill the promise with the sum.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">And we call\u00a0<code><strong>reject<\/strong><\/code>\u00a0to reject the promise with an error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then we can call\u00a0<code><strong>then<\/strong><\/code>\u00a0to get the resolved value and\u00a0<code><strong>catch<\/strong><\/code>\u00a0to get the error values:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"286\" height=\"149\" src=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/25-13.jpg\" alt=\"\" class=\"wp-image-6242\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We can work with JSON, local storage, promises, and loops with JavaScript.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript is one of the most popular programming languages for web programming. In this article, we\u2019ll look at the basic [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":6246,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[5294,5295,5258,5296],"class_list":["post-6226","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-javascrip","tag-json","tag-loops","tag-promises"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet\u200a-\u200ajson-loops-and-promises\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"JavaScript is one of the most popular programming languages for web programming. In this article, we\u2019ll look at the basic [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet\u200a-\u200ajson-loops-and-promises\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-12T15:20:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-12T15:28:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"615\" \/>\n\t<meta property=\"og:image:height\" content=\"300\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"dharmendra K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dharmendra K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/\"},\"author\":{\"name\":\"dharmendra K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/cd8e86c9e9d41f571c169472b896fc89\"},\"headline\":\"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises\",\"datePublished\":\"2021-05-12T15:20:55+00:00\",\"dateModified\":\"2021-05-12T15:28:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/\"},\"wordCount\":282,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg\",\"keywords\":[\"JavaScrip\",\"JSON\",\"loops\",\"Promises\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/\",\"name\":\"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg\",\"datePublished\":\"2021-05-12T15:20:55+00:00\",\"dateModified\":\"2021-05-12T15:28:11+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/cd8e86c9e9d41f571c169472b896fc89\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg\",\"contentUrl\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2021\\\/05\\\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg\",\"width\":615,\"height\":300},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/cd8e86c9e9d41f571c169472b896fc89\",\"name\":\"dharmendra K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3cbe7c92d93275f1313c076c322e0897b60f3d88bfcd9cddf106951a53a8e3c2?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3cbe7c92d93275f1313c076c322e0897b60f3d88bfcd9cddf106951a53a8e3c2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3cbe7c92d93275f1313c076c322e0897b60f3d88bfcd9cddf106951a53a8e3c2?s=96&d=mm&r=g\",\"caption\":\"dharmendra K\"},\"description\":\"A software engineer is a person who applies the principles of software engineering to the design, development, maintenance, testing, and evaluation of computer software.\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/dharmendra\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet\u200a-\u200ajson-loops-and-promises\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises - scmGalaxy","og_description":"JavaScript is one of the most popular programming languages for web programming. In this article, we\u2019ll look at the basic [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet\u200a-\u200ajson-loops-and-promises\/","og_site_name":"scmGalaxy","article_published_time":"2021-05-12T15:20:55+00:00","article_modified_time":"2021-05-12T15:28:11+00:00","og_image":[{"width":615,"height":300,"url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg","type":"image\/jpeg"}],"author":"dharmendra K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dharmendra K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/"},"author":{"name":"dharmendra K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/cd8e86c9e9d41f571c169472b896fc89"},"headline":"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises","datePublished":"2021-05-12T15:20:55+00:00","dateModified":"2021-05-12T15:28:11+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/"},"wordCount":282,"commentCount":0,"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg","keywords":["JavaScrip","JSON","loops","Promises"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/","name":"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#primaryimage"},"image":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#primaryimage"},"thumbnailUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg","datePublished":"2021-05-12T15:20:55+00:00","dateModified":"2021-05-12T15:28:11+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/cd8e86c9e9d41f571c169472b896fc89"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#primaryimage","url":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg","contentUrl":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2021\/05\/javascript-cheat-sheet\u200a\u2014\u200aJSON-Loops-and-Promises-1-1.jpg","width":615,"height":300},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/javascript-cheat-sheet%e2%80%8a-%e2%80%8ajson-loops-and-promises\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"JavaScript Cheat Sheet\u200a\u2014\u200aJSON, Loops, and Promises"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/cd8e86c9e9d41f571c169472b896fc89","name":"dharmendra K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3cbe7c92d93275f1313c076c322e0897b60f3d88bfcd9cddf106951a53a8e3c2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3cbe7c92d93275f1313c076c322e0897b60f3d88bfcd9cddf106951a53a8e3c2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3cbe7c92d93275f1313c076c322e0897b60f3d88bfcd9cddf106951a53a8e3c2?s=96&d=mm&r=g","caption":"dharmendra K"},"description":"A software engineer is a person who applies the principles of software engineering to the design, development, maintenance, testing, and evaluation of computer software.","url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/dharmendra\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=6226"}],"version-history":[{"count":2,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6226\/revisions"}],"predecessor-version":[{"id":6244,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/6226\/revisions\/6244"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media\/6246"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=6226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=6226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=6226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}