{"id":6458,"date":"2020-01-18T18:21:44","date_gmt":"2020-01-18T17:21:44","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=6458"},"modified":"2020-01-18T18:21:44","modified_gmt":"2020-01-18T17:21:44","slug":"what-is-the-difference-between-forin-and-forof-in-javascript","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2020\/01\/18\/what-is-the-difference-between-forin-and-forof-in-javascript\/","title":{"rendered":"What is the Difference Between \u2018for\u2026in\u2019 and \u2018for\u2026of\u2019 in JavaScript?"},"content":{"rendered":"<p><em><a href=\"https:\/\/medium.com\/better-programming\/what-is-the-difference-between-for-in-and-for-of-in-javascript-650952654e97\">What is the Difference Between \u2018for\u2026in\u2019 and \u2018for\u2026of\u2019 in JavaScript?<\/a><\/em><\/p>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote>\n<div>\n<div id=\"2b1f\" class=\"dz ea eb at ec b ed ee ef eg eh ei ej ek el em en\">\n<h1 class=\"ec b ed eo ef ep eh eq ej er el es eb\">What is the Difference Between \u2018for\u2026in\u2019 and \u2018for\u2026of\u2019 in JavaScript?<\/h1>\n<\/div>\n<\/div>\n<div id=\"0823\" class=\"et ea ax at as cu eu ev ew ex ey ez fa fb fc fd fe\">\n<h2 class=\"as cu eu ff ew fg ey fh fa fi fc fj ax\">One for enumerables, one for iterables\u2026how should you use each?<\/h2>\n<\/div>\n<div class=\"fk\">\n<div class=\"n fl fm fn fo\">\n<div class=\"o n\">\n<div>\n<div class=\"fp fq fr\">\n<div class=\"fs n ft o p do fu fv fw fx fy ds\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div class=\"fp fq fr\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"r fz fr fq\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/fit\/c\/96\/96\/2%2A_KGzadiy9s83D4vzhsCyyg.png?resize=48%2C48&#038;ssl=1\" alt=\"Jonathan Hsu\" width=\"48\" height=\"48\" \/><\/div>\n<\/div>\n<div class=\"ga ak r\">\n<div class=\"n\">\n<div>\n<div class=\"gb n o gc\"><span class=\"as cu gd au cc ge gf gg gh gi eb\"><a class=\"cy cz bb bc bd be bf bg bh bi gj bl bm dc dd\" href=\"https:\/\/medium.com\/@jhsu98?source=post_page-----650952654e97----------------------\" rel=\"noopener\">Jonathan Hsu<\/a><\/span><\/p>\n<div class=\"gk r ap h\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><a class=\"cy cz bb bc bd be bf bg bh bi gj bl bm dc dd\" href=\"https:\/\/medium.com\/better-programming\/what-is-the-difference-between-for-in-and-for-of-in-javascript-650952654e97?source=post_page-----650952654e97----------------------\" rel=\"noopener\">Dec 4, 2019<\/a> \u00b7 3 min read<\/div>\n<div class=\"n o\">\n<div class=\"hf r ap\"><\/div>\n<\/div>\n<div class=\"hf r ap\"><\/div>\n<div class=\"hg r ao\"><\/div>\n<article class=\"meteredContent\">\n<div>\n<section class=\"dt du dv dw dx\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah dy aj ak\">\n<figure class=\"hi hj hk hl hm hn dk dl paragraph-image\">\n<div class=\"ho hp fp hq ak\">\n<div class=\"dk dl hh\">\n<div class=\"hw r fp hx\">\n<div class=\"hy r\">\n<div class=\"hr hs do t u ht ak cc hu hv\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"do t u ht ak hz ia aq tq\" role=\"presentation\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/max\/60\/1%2At2gEyYWkttMqEll2XVCTjw.jpeg?resize=910%2C607&#038;ssl=1\" width=\"910\" height=\"607\" \/><\/div>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"of tp do t u ht ak ic\" role=\"presentation\" src=\"https:\/\/i0.wp.com\/miro.medium.com\/max\/3286\/1%2At2gEyYWkttMqEll2XVCTjw.jpeg?resize=910%2C607&#038;ssl=1\" width=\"910\" height=\"607\" \/><\/div>\n<\/div>\n<\/div>\n<\/div><figcaption class=\"ax gd id ie if dm dk dl ig ih as cu\" data-selectable-paragraph=\"\">Photo by <a class=\"cy by ii ij ik il\" href=\"https:\/\/unsplash.com\/@mroz?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">Filip Mroz<\/a> on <a class=\"cy by ii ij ik il\" href=\"https:\/\/unsplash.com\/s\/photos\/loop?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">Unsplash<\/a><\/figcaption><\/figure>\n<p id=\"6002\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">Looping has come a long way. Starting with <code class=\"\" data-line=\"\">while<\/code> loops and progressing to vanilla <code class=\"\" data-line=\"\">for<\/code> loops, neither iterate over the actual data structure. Rather, they iterate over a sequence that mirrors the identifiers for user.<\/p>\n<pre class=\"hi hj hk hl hm jc jd cl\"><span id=\"9cc7\" class=\"je jf eb at jb b gd jg jh r ji\" data-selectable-paragraph=\"\">let nums = [1,2,3,4,5];<\/span><span id=\"640b\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">for(let i=0; i &lt; nums.length; i++) {\n   console.log(nums[i]);\n}<\/span><\/pre>\n<p id=\"9a07\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">The variable <code class=\"\" data-line=\"\">i<\/code> is not actually part of <code class=\"\" data-line=\"\">nums<\/code>, but happens to be analogous to the indexes of <code class=\"\" data-line=\"\">nums<\/code>.<\/p>\n<p id=\"b196\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">Modern JavaScript has better ways to loop through data \u2014 specifically the <code class=\"\" data-line=\"\">for...in<\/code> and <code class=\"\" data-line=\"\">for...of<\/code> loops. Learn the difference between the two as well as the underlying principles that guide us in when to use each.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"jo cu jp jq jr if js jt ju jv jw\" \/>\n<section class=\"dt du dv dw dx\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah dy aj ak\">\n<h1 id=\"b509\" class=\"jx jf eb at as jy ed jz ef ka kb kc kd ke kf kg kh\" data-selectable-paragraph=\"\">Enumerables vs Iterables<\/h1>\n<p id=\"3030\" class=\"im in eb at io b eu ki ew kj ir kk it kl iv km ix\" data-selectable-paragraph=\"\">To understand the distinction between <code class=\"\" data-line=\"\">for...in<\/code> and <code class=\"\" data-line=\"\">for...of<\/code> it is important to define the difference between enumerables and iterables. This can be tricky since there is some overlap and the terms are often used interchangeably.<\/p>\n<p id=\"0083\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">I like to think of enumerables as a rectangle and iterables as a square. Consequently, all <strong class=\"io kn\">iterables are enumerables<\/strong>; however, not all enumerables are iterables.<\/p>\n<p id=\"440b\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">Keeping that in mind, let\u2019s dig deeper into their definitions.<\/p>\n<p id=\"b741\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">We\u2019ll define an <strong class=\"io kn\">enumerable <\/strong>first. The verb <em class=\"ko\">enumerate<\/em> is defined as making mention of \u2014 or counting \u2014 items one at a time. Applying that to programming, an enumerable becomes an entity where its parts can be distinctly identified and referenced.<\/p>\n<p id=\"475f\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">Now, on to an <strong class=\"io kn\">iterable<\/strong>. From the root verb <em class=\"ko\">iterate<\/em>, defined as performing in repetition, an iterable is an entity where the same set of actions are performed on each item.<\/p>\n<p id=\"b099\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">So what\u2019s the difference? Here are some examples of each before we highlight what elevates an enumerable to be an iterable:<\/p>\n<ul class=\"\">\n<li id=\"aacb\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix kp kq kr\" data-selectable-paragraph=\"\">A bag of M&amp;Ms is an enumerable<\/li>\n<li id=\"d9b2\" class=\"im in eb at io b eu ks ew kt ir ku it kv iv kw ix kp kq kr\" data-selectable-paragraph=\"\">The line at the DMV is an iterable<\/li>\n<li id=\"f62c\" class=\"im in eb at io b eu ks ew kt ir ku it kv iv kw ix kp kq kr\" data-selectable-paragraph=\"\">A pile of books is an enumerable<\/li>\n<li id=\"e484\" class=\"im in eb at io b eu ks ew kt ir ku it kv iv kw ix kp kq kr\" data-selectable-paragraph=\"\">A row of books on a shelf is an iterable<\/li>\n<li id=\"2f74\" class=\"im in eb at io b eu ks ew kt ir ku it kv iv kw ix kp kq kr\" data-selectable-paragraph=\"\">JSON objects are enumerables<\/li>\n<li id=\"63af\" class=\"im in eb at io b eu ks ew kt ir ku it kv iv kw ix kp kq kr\" data-selectable-paragraph=\"\">JSON arrays are iterables<\/li>\n<\/ul>\n<p id=\"2a70\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">Did you figure it the key quality? It\u2019s order. An iterable has an internal order to the pieces whereas an enumerable has distinct parts, but they are unordered.<\/p>\n<h1 id=\"e89a\" class=\"jx jf eb at as jy ed kx ef ky kb kz kd la kf lb kh\" data-selectable-paragraph=\"\">Using \u2018for\u2026in\u2019<\/h1>\n<p id=\"dc01\" class=\"im in eb at io b eu ki ew kj ir kk it kl iv km ix\" data-selectable-paragraph=\"\">We begin with <code class=\"\" data-line=\"\">for...in<\/code>, which is used to loop over an enumerable. This is perfect for counting over key-value pairs in an object, such as the example below.<\/p>\n<pre class=\"hi hj hk hl hm jc jd cl\"><span id=\"ec11\" class=\"je jf eb at jb b gd jg jh r ji\" data-selectable-paragraph=\"\">let person = {\n   \"first_name\": \"Jonathan\",\n   \"last_name\": \"Hsu\",\n   \"medium-handle\": \"<a class=\"cy by ii ij ik il\" href=\"http:\/\/twitter.com\/jhsu98\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">@jhsu98<\/a>\"\n}<\/span><span id=\"ebee\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">for(const key in person) {\n   console.log(key + \": \" + person[key]);\n}<\/span><span id=\"a051\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">\/*\n\"first_name: Jonathan\"\n\"last_name: Hsu\"\n\"medium-handle: @jhsu98\"\n*\/<\/span><\/pre>\n<p id=\"5364\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">As you can see, the <code class=\"\" data-line=\"\">for...in<\/code> loop will set the temporary variable to each key of the object. Therefore, in this case, what is being counted over are the identifiers.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"jo cu jp jq jr if js jt ju jv jw\" \/>\n<section class=\"dt du dv dw dx\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah dy aj ak\">\n<h1 id=\"a822\" class=\"jx jf eb at as jy ed jz ef ka kb kc kd ke kf kg kh\" data-selectable-paragraph=\"\">Using \u2018for\u2026of\u2019<\/h1>\n<p id=\"27e7\" class=\"im in eb at io b eu ki ew kj ir kk it kl iv km ix\" data-selectable-paragraph=\"\">OK, now we transition to the <code class=\"\" data-line=\"\">for...of<\/code> loop. This loop has a very similar syntax. However, an iterable is required after the <code class=\"\" data-line=\"\">of<\/code> keyword \u2014 in contrast to the requirement of an enumerable with <code class=\"\" data-line=\"\">in<\/code>.<\/p>\n<pre class=\"hi hj hk hl hm jc jd cl\"><span id=\"14f2\" class=\"je jf eb at jb b gd jg jh r ji\" data-selectable-paragraph=\"\">let scores = [43,58,28,69,38];<\/span><span id=\"4d21\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">for(const item of scores) {\n   console.log(item);\n}<\/span><span id=\"e6c8\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">\/*\n43\n58\n28\n69\n38\n*\/<\/span><\/pre>\n<p id=\"6f82\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">If we try to use <code class=\"\" data-line=\"\">for...of<\/code> with an enumerable, expect the following error:<\/p>\n<pre class=\"hi hj hk hl hm jc jd cl\"><span id=\"72b7\" class=\"je jf eb at jb b gd jg jh r ji\" data-selectable-paragraph=\"\">let person = {\n   \"first_name\": \"Jonathan\",\n   \"last_name\": \"Hsu\",\n   \"medium-handle\": \"<a class=\"cy by ii ij ik il\" href=\"http:\/\/twitter.com\/jhsu98\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">@jhsu98<\/a>\"\n}<\/span><span id=\"def4\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">for(const item of person) {\n   console.log(item);\n}<\/span><span id=\"4efb\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">\/*\n\"TypeError: person is not iterable\n    at gewuhimaza.js:6:84\n    at <a class=\"cy by ii ij ik il\" href=\"https:\/\/static.jsbin.com\/js\/prod\/runner-4.1.7.min.js:1:13924\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/static.jsbin.com\/js\/prod\/runner-4.1.7.min.js:1:13924<\/a>\n    at <a class=\"cy by ii ij ik il\" href=\"https:\/\/static.jsbin.com\/js\/prod\/runner-4.1.7.min.js:1:10866\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">https:\/\/static.jsbin.com\/js\/prod\/runner-4.1.7.min.js:1:10866<\/a>\"\n*\/<\/span><\/pre>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"jo cu jp jq jr if js jt ju jv jw\" \/>\n<section class=\"dt du dv dw dx\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah dy aj ak\">\n<h1 id=\"624f\" class=\"jx jf eb at as jy ed jz ef ka kb kc kd ke kf kg kh\" data-selectable-paragraph=\"\">I Thought Arrays Were Enumerables Too<\/h1>\n<p id=\"a295\" class=\"im in eb at io b eu ki ew kj ir kk it kl iv km ix\" data-selectable-paragraph=\"\">You\u2019re right! We saw that passing an enumerable to <code class=\"\" data-line=\"\">for...of<\/code> will cause an error, but passing an iterable to <code class=\"\" data-line=\"\">for...in<\/code> is accepted.<\/p>\n<pre class=\"hi hj hk hl hm jc jd cl\"><span id=\"d516\" class=\"je jf eb at jb b gd jg jh r ji\" data-selectable-paragraph=\"\">let scores = [43,58,28,69,38];<\/span><span id=\"9879\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">for(const item in scores) {\n   console.log(item);\n}<\/span><span id=\"3945\" class=\"je jf eb at jb b gd jj jk jl jm jn jh r ji\" data-selectable-paragraph=\"\">\/*\n\"0\"\n\"1\"\n\"2\"\n\"3\"\n\"4\"\n*\/<\/span><\/pre>\n<p id=\"e3f1\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\">Similar to how <code class=\"\" data-line=\"\">for...in<\/code> counts over the identifiers of the object, <code class=\"\" data-line=\"\">for...in<\/code> will count over the indexes \u2014 think of them as position identifiers.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"jo cu jp jq jr if js jt ju jv jw\" \/>\n<section class=\"dt du dv dw dx\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah dy aj ak\">\n<p id=\"e7c4\" class=\"im in eb at io b eu ip ew iq ir is it iu iv iw ix\" data-selectable-paragraph=\"\"><em class=\"ko\">There you have it. Iterables are a type of enumerable, with the extra quality being an order. Try to be more intentional when describing your data structures and spread the word on the differences between <\/em><code class=\"\" data-line=\"\">for...in<\/code><em class=\"ko\"> and <\/em><code class=\"\" data-line=\"\">for...of<\/code><em class=\"ko\">.<\/em><\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/div>\n<\/article>\n<div class=\"hr ds lc s ak li lg lj\" data-test-id=\"post-sidebar\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah ai aj ak\">\n<div class=\"lk n dn\">\n<div class=\"ds\">\n<div class=\"ll lm r\">\n<h2 class=\"as jy ln au eb\"><a href=\"https:\/\/medium.com\/better-programming\">Better Programming<\/a><\/h2>\n<div class=\"lo lp r\">\n<h4 class=\"as cu gd au cc lq gf gg lr gi ax\">Advice for programmers.<\/h4>\n<\/div>\n<div class=\"bx\" aria-hidden=\"true\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n o\">\n<div class=\"lw r fp\"><\/div>\n<\/div>\n<div class=\"mf r\">\n<div class=\"mg\">\n<h4 class=\"as cu gd au ax\"><\/h4>\n<\/div>\n<\/div>\n<div class=\"hr ds lc s ld fx le lf lg lh\"><\/div>\n<div>\n<div class=\"mh hn n dn p\">\n<div class=\"n p\">\n<div class=\"ac ae af ag ah dy aj ak\">\n<div class=\"n mi\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">What is the Difference Between \u2018for\u2026in\u2019 and \u2018for\u2026of\u2019 in JavaScript?<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2020\/01\/18\/what-is-the-difference-between-forin-and-forof-in-javascript\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"inline_featured_image":false,"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,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72,50],"tags":[],"class_list":["post-6458","post","type-post","status-publish","format-link","hentry","category-documentations","category-javascript","post_format-post-format-link"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1Ga","jetpack-related-posts":[{"id":1614,"url":"https:\/\/monodes.com\/predaelli\/2016\/06\/01\/javascript-factory-functions-vs-constructor-functions-vs-classes-javascript-scene-medium\/","url_meta":{"origin":6458,"position":0},"title":"JavaScript Factory Functions vs Constructor Functions vs Classes \u2014 JavaScript Scene \u2014 Medium","author":"Paolo Redaelli","date":"2016-06-01","format":"link","excerpt":"https:\/\/medium.com\/javascript-scene\/javascript-factory-functions-vs-constructor-functions-vs-classes-2f22ceddf33e#.13avjf4lk","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11779,"url":"https:\/\/monodes.com\/predaelli\/2024\/06\/29\/state-of-javascript-2023\/","url_meta":{"origin":6458,"position":1},"title":"State of JavaScript 2023","author":"Paolo Redaelli","date":"2024-06-29","format":false,"excerpt":"State of JavaScript 2023 The 2023 edition of the annual survey about the latest trends in the JavaScript ecosystem.","rel":"","context":"In &quot;Javascript&quot;","block_context":{"text":"Javascript","link":"https:\/\/monodes.com\/predaelli\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3228,"url":"https:\/\/monodes.com\/predaelli\/2017\/07\/20\/reverse-engineering-one-line-of-javascript\/","url_meta":{"origin":6458,"position":2},"title":"Reverse Engineering One Line of JavaScript","author":"Paolo Redaelli","date":"2017-07-20","format":false,"excerpt":"ASCII animations in 1 line of #JS. #JavaScript is really the assembler of the Web","rel":"","context":"In &quot;Javascript&quot;","block_context":{"text":"Javascript","link":"https:\/\/monodes.com\/predaelli\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11556,"url":"https:\/\/monodes.com\/predaelli\/2024\/04\/03\/bun-a-fast-all-in-one-javascript-runtime\/","url_meta":{"origin":6458,"position":3},"title":"Bun \u2014 A fast all-in-one JavaScript runtime","author":"Paolo Redaelli","date":"2024-04-03","format":"link","excerpt":"Bun \u2014 A fast all-in-one JavaScript runtime Bundle, install, and run JavaScript & TypeScript \u2014 all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner, and npm client built-in.","rel":"","context":"In &quot;Javascript&quot;","block_context":{"text":"Javascript","link":"https:\/\/monodes.com\/predaelli\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":11932,"url":"https:\/\/monodes.com\/predaelli\/2024\/09\/23\/bun-a-fast-all-in-one-javascript-runtime-2\/","url_meta":{"origin":6458,"position":4},"title":"Bun \u2014 A fast all-in-one JavaScript runtime","author":"Paolo Redaelli","date":"2024-09-23","format":false,"excerpt":"Bundle, install, and run JavaScript & TypeScript \u2014 all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner, and npm client built-in. Gonna try this Bun \u2014 A fast all-in-one JavaScript runtime","rel":"","context":"In &quot;Javascript&quot;","block_context":{"text":"Javascript","link":"https:\/\/monodes.com\/predaelli\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":13886,"url":"https:\/\/monodes.com\/predaelli\/2025\/08\/19\/crazy-javascripts-date-class\/","url_meta":{"origin":6458,"position":5},"title":"Crazy JavaScript&#8217;s Date class","author":"Paolo Redaelli","date":"2025-08-19","format":false,"excerpt":"new Date(\"wtf\") How well do you know JavaScript's Date class? JavaScript is a crazy, mad language. Or better, it's library is crazy. You can mostly blame automatic convertions","rel":"","context":"In &quot;Fun&quot;","block_context":{"text":"Fun","link":"https:\/\/monodes.com\/predaelli\/category\/fun\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/6458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=6458"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/6458\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=6458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=6458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=6458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}