{"id":3502,"date":"2022-06-21T14:00:00","date_gmt":"2022-06-21T14:00:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/"},"modified":"2026-03-11T05:59:01","modified_gmt":"2026-03-11T05:59:01","slug":"functional-programming-in-javascript-part-3-functor-monad-maybe","status":"publish","type":"post","link":"https:\/\/thecodest.co\/en\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/","title":{"rendered":"Functional programming in JavaScript Part 3 &#8211; Functor &#038; Monad Maybe"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>Often keeping unmodifiable is difficult to maintain. The pattern of wrapping <a href=\"https:\/\/thecodest.co\/en\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a> into a container comes to the rescue. It secures the values so that handling them is safe with the exclusion of side effects.<\/p>\n\n\n\n<p>If you are new here make sure to check my last 2 parts regarding functional programming on <a href=\"https:\/\/thecodest.co\/en\/blog\/vibrant-upturn-charting-the-resolute-rise-of-swedish-firms\/\">The Codest<\/a> blog about:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/thecodest.co\/blog\/power-of-functional-programming-in-javascript-part-1-introduction\">Part 1 &#8211; Introduction<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/thecodest.co\/blog\/power-of-functional-programming-in-javascript-part-2-combinators\">Part 2 &#8211; Combinators<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Functor<\/h2>\n\n\n\n<p>It has no complex logic. Its main task is to wrap the context and perform the functions it receives from the outside on them. Each time the value changes, a new container instance is repackaged and returned. When calling the <b>map<\/b> method, which takes a specific action, it returns a new container instance with the value returned by the passed function, while maintaining the non-modifiable principle.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Declaration<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\"><code> const Functor = value => ({\n     map: fn => Functor(fn(value)),\n     chain: fn => fn(value),\n     of: () => value\n });<\/code><\/code><\/pre>\n\n\n\n<p><b>map<\/b> &#8211; useful when you want to change the state of a value in a container but don&#8217;t want to return it yet.<\/p>\n\n\n\n<p><b>chain<\/b> &#8211; used if you want to pass a value to a function without modifying the container state. Usually at the end of <b>map<\/b> calls.<\/p>\n\n\n\n<p><b>of<\/b> &#8211; return current value<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Imperative example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const randomInt = (max) => Math.floor(Math.random() * (max + 1))\n\nconst randomNumber = randomInt(200) \/\/ returns number between 0 and 200\n\ndecrease(randomNumber) \/\/ returns (number between 0 and 200) - 1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Declarative example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const randomIntWrapper = (max) =>\nFunctor(max)\n.map(increase) \/\/ max + 1\n.map(multiplyBy(Math.random())) \/\/ Math.random() * (max + 1)\n.map(Math.floor) \/\/ Math.floor(Math.random() * (max + 1))\n\nconst randomNumber = randomIntWrapper(200)\n\nrandomNumber.of() \/\/ returns number between 0 and 200\nrandomNumber.chain(decrease) \/\/ returns (number between 0 and 200) - 1<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Monad<\/h2>\n\n\n\n<p>Sometimes, in addition to the functions that trigger the new state of the value, you need additional logic hidden in the container. This is where monad comes in handy, as it is an extension of <b>functor<\/b>. It can, for example, decide what should happen when the value has a certain value or what path the next actions are to take.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Monad Maybe<\/h2>\n\n\n\n<p>Monad maybe solves the problem of values that return not true. When this happens, subsequent <b>map<\/b> calls are ignored, but it allows you to return an alternative by calling the <b>getOr<\/b> method. It allows you to avoid the use of if \/ else operators, which are popular in <b>imperative<\/b> programming. This monad consists of three containers:<\/p>\n\n\n\n<p><b>Nothing<\/b> &#8211; runs when a value that is not true falls into the container or <strong>filter<\/strong> method returns false. It is used to simulate the execution of a function. This means that this container receives the function but does not execute it.<\/p>\n\n\n\n<p><b>Just<\/b> &#8211; this is the main container that performs all the functions, but if the value changes to a false value or <b>filter<\/b> method returns false, it will pass it to the <b>Nothing<\/b> container.<\/p>\n\n\n\n<p><b>Maybe<\/b> &#8211; I take the initial value and decide what container to call at the start.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Declaration<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const Just = value => ({\nmap: fn => Maybe(fn(value)),\nchain: fn => fn(value),\nof: () => value,\ngetOr: () => value,\nfilter: fn => fn(value) ? Just(value) : Nothing(),\ntype: 'just'\n});\n\nconst Nothing = () => ({\nmap: fn => Nothing(),\nchain: fn => fn(),\nof: () => Nothing(),\ngetOr: substitute => substitute,\nfilter: () => Nothing(),\ntype: 'nothing'\n});\n\nconst Maybe = value =>\nvalue === null || value === undefined || value.type === 'nothing'\n? Nothing()\n: Just(value)<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/table.png\" alt=\"table methods functor \" title=\"table functor \"\/><\/figure>\n\n\n\n<p>Now let&#8217;s build the previous example about the condition. If max is greater than zero, the function will be executed. Otherwise, it will return 0.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Imperative example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const randomInt = (max) => {\nif(max > 0) {\nreturn Math.floor(Math.random() * (max + 1))\n} else {\nreturn 0\n}\n}\n\nconst bookMiddlePage = 200\n\nconst randomPage = randomInt(10) || bookMiddlePage \/\/ returns random\nconst randomPage = randomInt(-10) || bookMiddlePage \/\/ returns 200<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Declarative example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const randomIntWrapper = (max) =>\nMaybe(max)\n.filter(max => max > 0) \/\/ value false ignores further calls\n.map(increase)\n.map(multiplyBy(Math.random()))\n.map(Math.floor)\n\nconst bookMiddlePage = 200\n\n\/\/ Just container\nconst randomPage = randomIntWrapper(10).getOr(bookMiddlePage) \/\/ returns random\n\/\/ Nothing container\nconst randomPage = randomIntWrapper(-10).getOr(bookMiddlePage) \/\/ returns 200<\/code><\/pre>\n\n\n\n<p><br><a href=\"https:\/\/thecodest.co\/contact\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/interested_in_cooperation_.png\" alt=\"cooperation banner\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.<\/p>\n","protected":false},"author":2,"featured_media":3503,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3502","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Functional programming in JavaScript Part 3 - Functor &amp; Monad Maybe - The Codest<\/title>\n<meta name=\"description\" content=\"Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/en\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Functional programming in JavaScript Part 3 - Functor &amp; Monad Maybe\" \/>\n<meta property=\"og:description\" content=\"Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/en\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-21T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-11T05:59:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Functional programming in JavaScript Part 3 &#8211; Functor &#038; Monad Maybe\",\"datePublished\":\"2022-06-21T14:00:00+00:00\",\"dateModified\":\"2026-03-11T05:59:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/\"},\"wordCount\":437,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/\",\"name\":\"Functional programming in JavaScript Part 3 - Functor & Monad Maybe - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png\",\"datePublished\":\"2022-06-21T14:00:00+00:00\",\"dateModified\":\"2026-03-11T05:59:01+00:00\",\"description\":\"Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/functional-programming-in-javascript-part-3-functor-monad-maybe\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Functional programming in JavaScript Part 3 &#8211; Functor &#038; Monad Maybe\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/en\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Functional programming in JavaScript Part 3 - Functor & Monad Maybe - The Codest","description":"Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.","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:\/\/thecodest.co\/en\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/","og_locale":"en_US","og_type":"article","og_title":"Functional programming in JavaScript Part 3 - Functor & Monad Maybe","og_description":"Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.","og_url":"https:\/\/thecodest.co\/en\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/","og_site_name":"The Codest","article_published_time":"2022-06-21T14:00:00+00:00","article_modified_time":"2026-03-11T05:59:01+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Functional programming in JavaScript Part 3 &#8211; Functor &#038; Monad Maybe","datePublished":"2022-06-21T14:00:00+00:00","dateModified":"2026-03-11T05:59:01+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/"},"wordCount":437,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png","articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/","url":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/","name":"Functional programming in JavaScript Part 3 - Functor & Monad Maybe - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png","datePublished":"2022-06-21T14:00:00+00:00","dateModified":"2026-03-11T05:59:01+00:00","description":"Check the third part of our Power of functional programming in JavaScript article series. This time our JavaScript expert explains more about Functor and Monad Maybe.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/power_of_functional_programming_in_javascript_part_3_-_functor_-_monad_maybe.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/functional-programming-in-javascript-part-3-functor-monad-maybe\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Functional programming in JavaScript Part 3 &#8211; Functor &#038; Monad Maybe"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/en\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts\/3502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/comments?post=3502"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts\/3502\/revisions"}],"predecessor-version":[{"id":8386,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/posts\/3502\/revisions\/8386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/media\/3503"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/media?parent=3502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/categories?post=3502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/en\/wp-json\/wp\/v2\/tags?post=3502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}