CINXE.COM
JavaScript data types and data structures - JavaScript | MDN
<!doctype html> <html lang="en-US" prefix="og: https://ogp.me/ns#"> <head> <base href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <link rel="icon" href="https://developer.mozilla.org/favicon-48x48.bc390275e955dacb2e65.png"> <link rel="apple-touch-icon" href="https://developer.mozilla.org/apple-touch-icon.528534bba673c38049c2.png"> <meta name="theme-color" content="#ffffff"> <link rel="manifest" href="https://developer.mozilla.org/manifest.f42880861b394dd4dc9b.json"> <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="MDN Web Docs"> <title>JavaScript data types and data structures - JavaScript | MDN</title> <link rel="alternate" title="JavaScript Datentypen und Datenstrukturen" href="https://developer.mozilla.org/de/docs/Web/JavaScript/Data_structures" hreflang="de"> <link rel="alternate" title="Tipos de datos y estructuras en JavaScript" href="https://developer.mozilla.org/es/docs/Web/JavaScript/Data_structures" hreflang="es"> <link rel="alternate" title="Types et structures de données JavaScript" href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Data_structures" hreflang="fr"> <link rel="alternate" title="JavaScript のデータ型とデータ構造" href="https://developer.mozilla.org/ja/docs/Web/JavaScript/Data_structures" hreflang="ja"> <link rel="alternate" title="JavaScript의 타입과 자료구조" href="https://developer.mozilla.org/ko/docs/Web/JavaScript/Data_structures" hreflang="ko"> <link rel="alternate" title="Estrutura de dados do Javascript" href="https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Data_structures" hreflang="pt"> <link rel="alternate" title="Типы и структуры данных JavaScript" href="https://developer.mozilla.org/ru/docs/Web/JavaScript/Data_structures" hreflang="ru"> <link rel="alternate" title="JavaScript 数据类型和数据结构" href="https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Data_structures" hreflang="zh"> <link rel="alternate" title="JavaScript 的資料型別與資料結構" href="https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Data_structures" hreflang="zh-Hant"> <link rel="alternate" title="JavaScript data types and data structures" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures" hreflang="en"> <link rel="preload" as="font" type="font/woff2" href="/static/media/Inter.var.c2fe3cb2b7c746f7966a.woff2" crossorigin=""> <link rel="alternate" type="application/rss+xml" title="MDN Blog RSS Feed" href="https://developer.mozilla.org/en-US/blog/rss.xml" hreflang="en"> <meta name="description" content="Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures."> <meta property="og:url" content="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures"> <meta property="og:title" content="JavaScript data types and data structures - JavaScript | MDN"> <meta property="og:type" content="website"> <meta property="og:locale" content="en_US"> <meta property="og:description" content="Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures."> <meta property="og:image" content="https://developer.mozilla.org/mdn-social-share.d893525a4fb5fb1f67a2.png"> <meta property="og:image:type" content="image/png"> <meta property="og:image:height" content="1080"> <meta property="og:image:width" content="1920"> <meta property="og:image:alt" content="The MDN Web Docs logo, featuring a blue accent color, displayed on a solid black background."> <meta property="og:site_name" content="MDN Web Docs"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:creator" content="MozDevNet"> <link rel="canonical" href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures"> <style media="print">.article-actions-container,.document-toc-container,.language-menu,.main-menu-toggle,.on-github,.page-footer,.place,.sidebar,.top-banner,.top-navigation-main,ul.prev-next{display:none!important}.main-page-content,.main-page-content pre{padding:2px}.main-page-content pre{border-left-width:2px}</style> <script src="/static/js/gtag.js" defer></script> <script defer src="/static/js/main.06414919.js"></script> <link href="/static/css/main.4634a21c.css" rel="stylesheet"> <meta http-equiv="X-Translated-By" content="Google"> <meta http-equiv="X-Translated-To" content="tr"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.SlmlLUpNCG8.O/am=gAE/d=1/rs=AN8SPfrVDwgQMj0EYXdUQwFqbkL3aXptKg/m=corsproxy" data-sourceurl="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures"></script> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.SlmlLUpNCG8.O/am=gAE/d=1/exm=corsproxy/ed=1/rs=AN8SPfrVDwgQMj0EYXdUQwFqbkL3aXptKg/m=phishing_protection" data-phishing-protection-enabled="false" data-forms-warning-enabled="true" data-source-url="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures"></script> <meta name="robots" content="none"> </head> <body> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.SlmlLUpNCG8.O/am=gAE/d=1/exm=corsproxy,phishing_protection/ed=1/rs=AN8SPfrVDwgQMj0EYXdUQwFqbkL3aXptKg/m=navigationui" data-environment="prod" data-proxy-url="https://developer-mozilla-org.translate.goog" data-proxy-full-url="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" data-source-url="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures" data-source-language="pl" data-target-language="tr" data-display-language="en-GB" data-detected-source-language="" data-is-source-untranslated="false" data-source-untranslated-url="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures&anno=2" data-client="tr"></script> <script>if(document.body.addEventListener("load",(t=>{t.target.classList.contains("interactive")&&t.target.setAttribute("data-readystate","complete")}),{capture:!0}),window&&document.documentElement){const t={light:"#ffffff",dark:"#1b1b1b"};try{const e=window.localStorage.getItem("theme");e&&(document.documentElement.className=e,document.documentElement.style.backgroundColor=t[e]);const o=window.localStorage.getItem("nop");o&&(document.documentElement.dataset.nop=o)}catch(t){console.warn("Unable to read theme from localStorage",t)}}</script> <div id="root"> <ul id="nav-access" class="a11y-nav"> <li><a id="skip-main" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#content">Skip to main content</a></li> <li><a id="skip-search" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#top-nav-search-input">Skip to search</a></li> <li><a id="skip-select-language" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#languages-switcher-button">Skip to select language</a></li> </ul> <div class="page-wrapper category-javascript document-page"> <div class="top-banner loading"> <section class="place top container"></section> </div> <div class="sticky-header-container"> <header class="top-navigation "> <div class="container "> <div class="top-navigation-wrap"> <a href="https://developer-mozilla-org.translate.goog/en-US/?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="logo" aria-label="MDN homepage"> <svg id="mdn-docs-logo" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewbox="0 0 694.9 104.4" style="enable-background:new 0 0 694.9 104.4" xml:space="preserve" role="img"> <title>MDN Web Docs</title><path d="M40.3 0 11.7 92.1H0L28.5 0h11.8zm10.4 0v92.1H40.3V0h10.4zM91 0 62.5 92.1H50.8L79.3 0H91zm10.4 0v92.1H91V0h10.4z" class="logo-m"></path><path d="M627.9 95.6h67v8.8h-67v-8.8z" class="logo-_"></path><path d="M367 42h-4l-10.7 30.8h-5.5l-10.8-26h-.4l-10.5 26h-5.2L308.7 42h-3.8v-5.6H323V42h-6.5l6.8 20.4h.4l10.3-26h4.7l11.2 26h.5l5.7-20.3h-6.2v-5.6H367V42zm34.9 20c-.4 3.2-2 5.9-4.7 8.2-2.8 2.3-6.5 3.4-11.3 3.4-5.4 0-9.7-1.6-13.1-4.7-3.3-3.2-5-7.7-5-13.7 0-5.7 1.6-10.3 4.7-14s7.4-5.5 12.9-5.5c5.1 0 9.1 1.6 11.9 4.7s4.3 6.9 4.3 11.3c0 1.5-.2 3-.5 4.7h-25.6c.3 7.7 4 11.6 10.9 11.6 2.9 0 5.1-.7 6.5-2 1.5-1.4 2.5-3 3-4.9l6 .9zM394 51.3c.2-2.4-.4-4.7-1.8-6.9s-3.8-3.3-7-3.3c-3.1 0-5.3 1-6.9 3-1.5 2-2.5 4.4-2.8 7.2H394zm51 2.4c0 5-1.3 9.5-4 13.7s-6.9 6.2-12.7 6.2c-6 0-10.3-2.2-12.7-6.7-.1.4-.2 1.4-.4 2.9s-.3 2.5-.4 2.9h-7.3c.3-1.7.6-3.5.8-5.3.3-1.8.4-3.7.4-5.5V22.3h-6v-5.6H416v27c1.1-2.2 2.7-4.1 4.7-5.7 2-1.6 4.8-2.4 8.4-2.4 4.6 0 8.4 1.6 11.4 4.7 3 3.2 4.5 7.6 4.5 13.4zm-7.7.6c0-4.2-1-7.4-3-9.5-2-2.2-4.4-3.3-7.4-3.3-3.4 0-6 1.2-8 3.7-1.9 2.4-2.9 5-3 7.7V57c0 3 1 5.6 3 7.7s4.5 3.1 7.6 3.1c3.6 0 6.3-1.3 8.1-3.9 1.8-2.7 2.7-5.9 2.7-9.6zm69.2 18.5h-13.2v-7.2c-1.2 2.2-2.8 4.1-4.9 5.6-2.1 1.6-4.8 2.4-8.3 2.4-4.8 0-8.7-1.6-11.6-4.9-2.9-3.2-4.3-7.7-4.3-13.3 0-5 1.3-9.6 4-13.7 2.6-4.1 6.9-6.2 12.8-6.2 5.7 0 9.8 2.2 12.3 6.5V22.3h-8.6v-5.6h15.8v50.6h6v5.5zM493.2 56v-4.4c-.1-3-1.2-5.5-3.2-7.3s-4.4-2.8-7.2-2.8c-3.6 0-6.3 1.3-8.2 3.9-1.9 2.6-2.8 5.8-2.8 9.6 0 4.1 1 7.3 3 9.5s4.5 3.3 7.4 3.3c3.2 0 5.8-1.3 7.8-3.8 2.1-2.6 3.1-5.3 3.2-8zm53.1-1.4c0 5.6-1.8 10.2-5.3 13.7s-8.2 5.3-13.9 5.3-10.1-1.7-13.4-5.1c-3.3-3.4-5-7.9-5-13.5 0-5.3 1.6-9.9 4.7-13.7 3.2-3.8 7.9-5.7 14.2-5.7s11 1.9 14.1 5.7c3 3.7 4.6 8.1 4.6 13.3zm-7.7-.2c0-4-1-7.2-3-9.5s-4.8-3.5-8.2-3.5c-3.6 0-6.4 1.2-8.3 3.7s-2.9 5.6-2.9 9.5c0 3.7.9 6.8 2.8 9.4 1.9 2.6 4.6 3.9 8.3 3.9 3.6 0 6.4-1.3 8.4-3.8 1.9-2.6 2.9-5.8 2.9-9.7zm45 5.8c-.4 3.2-1.9 6.3-4.4 9.1-2.5 2.9-6.4 4.3-11.8 4.3-5.2 0-9.4-1.6-12.6-4.8-3.2-3.2-4.8-7.7-4.8-13.7 0-5.5 1.6-10.1 4.7-13.9 3.2-3.8 7.6-5.7 13.2-5.7 2.3 0 4.6.3 6.7.8 2.2.5 4.2 1.5 6.2 2.9l1.5 9.5-5.9.7-1.3-6.1c-2.1-1.2-4.5-1.8-7.2-1.8-3.5 0-6.1 1.2-7.7 3.7-1.7 2.5-2.5 5.7-2.5 9.6 0 4.1.9 7.3 2.7 9.5 1.8 2.3 4.4 3.4 7.8 3.4 5.2 0 8.2-2.9 9.2-8.8l6.2 1.3zm34.7 1.9c0 3.6-1.5 6.5-4.6 8.5s-7 3-11.7 3c-5.7 0-10.6-1.2-14.6-3.6l1.2-8.8 5.7.6-.2 4.7c1.1.5 2.3.9 3.6 1.1s2.6.3 3.9.3c2.4 0 4.5-.4 6.5-1.3 1.9-.9 2.9-2.2 2.9-4.1 0-1.8-.8-3.1-2.3-3.8s-3.5-1.3-5.8-1.7-4.6-.9-6.9-1.4c-2.3-.6-4.2-1.6-5.7-2.9-1.6-1.4-2.3-3.5-2.3-6.3 0-4.1 1.5-6.9 4.6-8.5s6.4-2.4 9.9-2.4c2.6 0 5 .3 7.2.9 2.2.6 4.3 1.4 6.1 2.4l.8 8.8-5.8.7-.8-5.7c-2.3-1-4.7-1.6-7.2-1.6-2.1 0-3.7.4-5.1 1.1-1.3.8-2 2-2 3.8 0 1.7.8 2.9 2.3 3.6 1.5.7 3.4 1.2 5.7 1.6 2.2.4 4.5.8 6.7 1.4 2.2.6 4.1 1.6 5.7 3 1.4 1.6 2.2 3.7 2.2 6.6zM197.6 73.2h-17.1v-5.5h3.8V51.9c0-3.7-.7-6.3-2.1-7.9-1.4-1.6-3.3-2.3-5.7-2.3-3.2 0-5.6 1.1-7.2 3.4s-2.4 4.6-2.5 6.9v15.6h6v5.5h-17.1v-5.5h3.8V51.9c0-3.8-.7-6.4-2.1-7.9-1.4-1.5-3.3-2.3-5.6-2.3-3.2 0-5.5 1.1-7.2 3.3-1.6 2.2-2.4 4.5-2.5 6.9v15.8h6.9v5.5h-20.2v-5.5h6V42.4h-6.1v-5.6h13.4v6.4c1.2-2.1 2.7-3.8 4.7-5.2 2-1.3 4.4-2 7.3-2s5.3.7 7.5 2.1c2.2 1.4 3.7 3.5 4.5 6.4 1.1-2.5 2.7-4.5 4.9-6.1s4.8-2.4 7.9-2.4c3.5 0 6.5 1.1 8.9 3.3s3.7 5.6 3.7 10.2v18.2h6.1v5.5zm42.5 0h-13.2V66c-1.2 2.2-2.8 4.1-4.9 5.6-2.1 1.6-4.8 2.4-8.3 2.4-4.8 0-8.7-1.6-11.6-4.9-2.9-3.2-4.3-7.7-4.3-13.3 0-5 1.3-9.6 4-13.7 2.6-4.1 6.9-6.2 12.8-6.2s9.8 2.2 12.3 6.5V22.7h-8.6v-5.6h15.8v50.6h6v5.5zm-13.3-16.8V52c-.1-3-1.2-5.5-3.2-7.3s-4.4-2.8-7.2-2.8c-3.6 0-6.3 1.3-8.2 3.9-1.9 2.6-2.8 5.8-2.8 9.6 0 4.1 1 7.3 3 9.5s4.5 3.3 7.4 3.3c3.2 0 5.8-1.3 7.8-3.8 2.1-2.6 3.1-5.3 3.2-8zm61.5 16.8H269v-5.5h6V51.9c0-3.7-.7-6.3-2.2-7.9-1.4-1.6-3.4-2.3-5.7-2.3-3.1 0-5.6 1-7.4 3s-2.8 4.4-2.9 7v15.9h6v5.5h-19.3v-5.5h6V42.4h-6.2v-5.6h13.6V43c2.6-4.6 6.8-6.9 12.7-6.9 3.6 0 6.7 1.1 9.2 3.3s3.7 5.6 3.7 10.2v18.2h6v5.4h-.2z" class="logo-text"></path> </svg></a><button title="Open main menu" type="button" class="button action has-icon main-menu-toggle" aria-haspopup="menu" aria-label="Open main menu" aria-expanded="false"><span class="button-wrap"><span class="icon icon-menu "></span><span class="visually-hidden">Open main menu</span></span></button> </div> <div class="top-navigation-main"> <nav class="main-nav" aria-label="Main menu"> <ul class="main-menu nojs"> <li class="top-level-entry-container active"><button type="button" id="references-button" class="top-level-entry menu-toggle" aria-controls="references-menu" aria-expanded="false">References</button><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="top-level-entry">References</a> <ul id="references-menu" class="submenu references hidden inline-submenu-lg" aria-labelledby="references-button"> <li class="apis-link-container mobile-only "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Overview / Web Technology </div> <p class="submenu-item-description">Web technology reference for developers</p> </div></a></li> <li class="html-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/HTML?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon html"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> HTML </div> <p class="submenu-item-description">Structure of content on the web</p> </div></a></li> <li class="css-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/CSS?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon css"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> CSS </div> <p class="submenu-item-description">Code used to describe document style</p> </div></a></li> <li class="javascript-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon javascript"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> JavaScript </div> <p class="submenu-item-description">General-purpose scripting language</p> </div></a></li> <li class="http-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/HTTP?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon http"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> HTTP </div> <p class="submenu-item-description">Protocol for transmitting web resources</p> </div></a></li> <li class="apis-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/API?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon apis"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Web APIs </div> <p class="submenu-item-description">Interfaces for building web applications</p> </div></a></li> <li class="apis-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Mozilla/Add-ons/WebExtensions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Web Extensions </div> <p class="submenu-item-description">Developing extensions for web browsers</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/Accessibility?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Accessibility </div> <p class="submenu-item-description">Build web projects usable for all</p> </div></a></li> <li class="apis-link-container desktop-only "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Web Technology </div> <p class="submenu-item-description">Web technology reference for developers</p> </div></a></li> </ul></li> <li class="top-level-entry-container "><button type="button" id="learn-button" class="top-level-entry menu-toggle" aria-controls="learn-menu" aria-expanded="false">Learn</button><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="top-level-entry">Learn</a> <ul id="learn-menu" class="submenu learn hidden inline-submenu-lg" aria-labelledby="learn-button"> <li class="apis-link-container mobile-only "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon learn"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Overview / MDN Learning Area </div> <p class="submenu-item-description">Learn web development</p> </div></a></li> <li class="apis-link-container desktop-only "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon learn"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> MDN Learning Area </div> <p class="submenu-item-description">Learn web development</p> </div></a></li> <li class="html-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Core/Structuring_content?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon html"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> HTML </div> <p class="submenu-item-description">Learn to structure web content with HTML</p> </div></a></li> <li class="css-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Core/Styling_basics?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon css"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> CSS </div> <p class="submenu-item-description">Learn to style content using CSS</p> </div></a></li> <li class="javascript-link-container "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Core/Scripting?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon javascript"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> JavaScript </div> <p class="submenu-item-description">Learn to run scripts in the browser</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Core/Accessibility?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Accessibility </div> <p class="submenu-item-description">Learn to make the web accessible to all</p> </div></a></li> </ul></li> <li class="top-level-entry-container "><button type="button" id="mdn-plus-button" class="top-level-entry menu-toggle" aria-controls="mdn-plus-menu" aria-expanded="false">Plus</button><a href="https://developer-mozilla-org.translate.goog/en-US/plus?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="top-level-entry">Plus</a> <ul id="mdn-plus-menu" class="submenu mdn-plus hidden inline-submenu-lg" aria-labelledby="mdn-plus-button"> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/plus?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Overview </div> <p class="submenu-item-description">A customized MDN experience</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/plus/ai-help?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> AI Help </div> <p class="submenu-item-description">Get real-time assistance and support</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/plus/updates?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Updates </div> <p class="submenu-item-description">All browser compatibility updates at a glance</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/plus/docs/features/overview?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Documentation </div> <p class="submenu-item-description">Learn how to use MDN Plus</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/plus/docs/faq?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> FAQ </div> <p class="submenu-item-description">Frequently asked questions about MDN Plus</p> </div></a></li> </ul></li> <li class="top-level-entry-container "><a class="top-level-entry menu-link" href="https://developer-mozilla-org.translate.goog/en-US/curriculum/?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Curriculum <sup class="new">New</sup></a></li> <li class="top-level-entry-container "><a class="top-level-entry menu-link" href="https://developer-mozilla-org.translate.goog/en-US/blog/?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Blog</a></li> <li class="top-level-entry-container "><button type="button" id="tools-button" class="top-level-entry menu-toggle" aria-controls="tools-menu" aria-expanded="false">Tools</button> <ul id="tools-menu" class="submenu tools hidden inline-submenu-lg" aria-labelledby="tools-button"> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/play?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> Playground </div> <p class="submenu-item-description">Write, test and share your code</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/observatory?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> HTTP Observatory </div> <p class="submenu-item-description">Scan a website for free</p> </div></a></li> <li class=" "><a href="https://developer-mozilla-org.translate.goog/en-US/plus/ai-help?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="submenu-item "> <div class="submenu-icon"></div> <div class="submenu-content-container"> <div class="submenu-item-heading"> AI Help </div> <p class="submenu-item-description">Get real-time assistance and support</p> </div></a></li> </ul></li> </ul> </nav> <div class="header-search"> <form action="/en-US/search" class="search-form search-widget" id="top-nav-search-form" role="search"> <label id="top-nav-search-label" for="top-nav-search-input" class="visually-hidden">Search MDN</label><input aria-activedescendant="" aria-autocomplete="list" aria-controls="top-nav-search-menu" aria-expanded="false" aria-labelledby="top-nav-search-label" autocomplete="off" id="top-nav-search-input" role="combobox" type="search" class="search-input-field" name="q" placeholder=" " required value=""><button type="button" class="button action has-icon clear-search-button"><span class="button-wrap"><span class="icon icon-cancel "></span><span class="visually-hidden">Clear search input</span></span></button><button type="submit" class="button action has-icon search-button"><span class="button-wrap"><span class="icon icon-search "></span><span class="visually-hidden">Search</span></span></button> <div id="top-nav-search-menu" role="listbox" aria-labelledby="top-nav-search-label"></div> </form> </div> <div class="theme-switcher-menu"> <button type="button" class="button action has-icon theme-switcher-menu small" aria-haspopup="menu"><span class="button-wrap"><span class="icon icon-theme-os-default "></span>Theme</span></button> </div> <ul class="auth-container"> <li><a href="https://developer-mozilla-org.translate.goog/users/fxa/login/authenticate/?next=/en-US/docs/Web/JavaScript/Data_structures&_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="login-link" rel="nofollow">Log in</a></li> <li><a href="https://developer-mozilla-org.translate.goog/users/fxa/login/authenticate/?next=/en-US/docs/Web/JavaScript/Data_structures&_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" target="_self" rel="nofollow" class="button primary mdn-plus-subscribe-link"><span class="button-wrap">Sign up for free</span></a></li> </ul> </div> </div> </header> <div class="article-actions-container"> <div class="container"> <button type="button" class="button action has-icon sidebar-button" aria-label="Expand sidebar" aria-expanded="false" aria-controls="sidebar-quicklinks"><span class="button-wrap"><span class="icon icon-sidebar "></span></span></button> <nav class="breadcrumbs-container" aria-label="Breadcrumb"> <ol typeof="BreadcrumbList" vocab="https://schema.org/" aria-label="breadcrumbs"> <li property="itemListElement" typeof="ListItem"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="breadcrumb" property="item" typeof="WebPage"><span property="name">References</span></a> <meta property="position" content="1"></li> <li property="itemListElement" typeof="ListItem"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="breadcrumb" property="item" typeof="WebPage"><span property="name">JavaScript</span></a> <meta property="position" content="2"></li> <li property="itemListElement" typeof="ListItem"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="breadcrumb-current-page" property="item" typeof="WebPage"><span property="name">JavaScript data types and data structures</span></a> <meta property="position" content="3"></li> </ol> </nav> <div class="article-actions"> <button type="button" class="button action has-icon article-actions-toggle" aria-label="Article actions"><span class="button-wrap"><span class="icon icon-ellipses "></span><span class="article-actions-dialog-heading">Article Actions</span></span></button> <ul class="article-actions-entries"> <li class="article-actions-entry"> <div class="languages-switcher-menu open-on-focus-within"> <button id="languages-switcher-button" type="button" class="button action small has-icon languages-switcher-menu" aria-haspopup="menu"><span class="button-wrap"><span class="icon icon-language "></span>English (US)</span></button> <div class="hidden"> <ul class="submenu language-menu " aria-labelledby="language-menu-button"> <li class=" "> <form class="submenu-item locale-redirect-setting"> <div class="group"> <label class="switch"><input type="checkbox" name="locale-redirect"><span class="slider"></span><span class="label">Remember language</span></label><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/orgs/mdn/discussions/739" rel="external noopener noreferrer" target="_blank" title="Enable this setting to automatically switch to this language when it's available. (Click to learn more.)"><span class="icon icon-question-mark "></span></a> </div> </form></li> <li class=" "><a data-locale="de" href="https://developer-mozilla-org.translate.goog/de/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>Deutsch</span><span title="Diese Übersetzung ist Teil eines Experiments."><span class="icon icon-experimental "></span></span></a></li> <li class=" "><a data-locale="es" href="https://developer-mozilla-org.translate.goog/es/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>Español</span></a></li> <li class=" "><a data-locale="fr" href="https://developer-mozilla-org.translate.goog/fr/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>Français</span></a></li> <li class=" "><a data-locale="ja" href="https://developer-mozilla-org.translate.goog/ja/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>日本語</span></a></li> <li class=" "><a data-locale="ko" href="https://developer-mozilla-org.translate.goog/ko/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>한국어</span></a></li> <li class=" "><a data-locale="pt-BR" href="https://developer-mozilla-org.translate.goog/pt-BR/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>Português (do Brasil)</span></a></li> <li class=" "><a data-locale="ru" href="https://developer-mozilla-org.translate.goog/ru/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>Русский</span></a></li> <li class=" "><a data-locale="zh-CN" href="https://developer-mozilla-org.translate.goog/zh-CN/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>中文 (简体)</span></a></li> <li class=" "><a data-locale="zh-TW" href="https://developer-mozilla-org.translate.goog/zh-TW/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="button submenu-item"><span>正體中文 (繁體)</span></a></li> </ul> </div> </div></li> </ul> </div> </div> </div> </div> <div class="main-wrapper"> <div class="sidebar-container"> <aside id="sidebar-quicklinks" class="sidebar"> <button type="button" class="button action backdrop" aria-label="Collapse sidebar"><span class="button-wrap"></span></button> <nav aria-label="Related Topics" class="sidebar-inner"> <header class="sidebar-actions"> <section class="sidebar-filter-container"> <div class="sidebar-filter "> <label id="sidebar-filter-label" class="sidebar-filter-label" for="sidebar-filter-input"><span class="icon icon-filter"></span><span class="visually-hidden">Filter sidebar</span></label><input id="sidebar-filter-input" autocomplete="off" class="sidebar-filter-input-field false" type="text" placeholder="Filter" value=""><button type="button" class="button action has-icon clear-sidebar-filter-button"><span class="button-wrap"><span class="icon icon-cancel "></span><span class="visually-hidden">Clear filter input</span></span></button> </div> </section> </header> <div class="sidebar-inner-nav"> <div class="in-nav-toc"> <div class="document-toc-container"> <section class="document-toc"> <header> <h2 class="document-toc-heading">In this article</h2> </header> <ul class="document-toc-list"> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#dynamic_and_weak_typing">Dynamic and weak typing</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#primitive_values">Primitive values</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#objects">Objects</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#type_coercion">Type coercion</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#see_also">See also</a></li> </ul> </section> </div> </div> <div class="sidebar-body"> <ol> <li class="section"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">JavaScript</a></li> <li class="section">Tutorials and guides</li> <li class="toggle"> <details> <summary>Beginner's tutorials</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Getting_started/Your_first_website/Adding_interactivity?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Your first website: Adding interactivity</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Core/Scripting?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Dynamic scripting with JavaScript</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Core/Frameworks_libraries?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">JavaScript frameworks and libraries</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>JavaScript Guide</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Introduction?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Introduction</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Grammar_and_types?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Grammar and types</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Control flow and error handling</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Loops and iteration</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Functions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Functions</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Expressions and operators</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Numbers_and_strings?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Numbers and strings</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Representing_dates_times?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Representing dates & times</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Regular_expressions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Regular expressions</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Indexed_collections?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Indexed collections</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Keyed_collections?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Keyed collections</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Working_with_objects?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Working with objects</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Using_classes?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Using classes</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Using_promises?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Using promises</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Typed_arrays?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">JavaScript typed arrays</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Iterators and generators</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Internationalization?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Internationalization</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Meta_programming?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Meta programming</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Modules?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">JavaScript modules</a></li> </ol> </details></li> <li class="toggle"> <details open> <summary>Intermediate</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Extensions/Advanced_JavaScript_objects?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Advanced JavaScript objects</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Extensions/Async_JS?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Asynchronous JavaScript</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn_web_development/Extensions/Client-side_APIs?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Client-side web APIs</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Language_overview?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Language overview</a></li> <li><em><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" aria-current="page">JavaScript data structures</a></em></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Equality comparisons and sameness</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Enumerability and ownership of properties</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Closures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Closures</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Advanced</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Inheritance and the prototype chain</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Memory_management?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Memory Management</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Event_loop?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Concurrency model and Event Loop</a></li> </ol> </details></li> <li class="section"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">References</a></li> <li class="toggle"> <details> <summary>Built-in objects</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">AggregateError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ArrayBuffer</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">AsyncFunction</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">AsyncGenerator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGeneratorFunction?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">AsyncGeneratorFunction</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">AsyncIterator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Atomics</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">BigInt</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">BigInt64Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">BigUint64Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Boolean</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">DataView</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Date</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">decodeURI()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">decodeURIComponent()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">encodeURI()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">encodeURIComponent()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Error</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">escape()</a><abbr class="icon icon-deprecated" title="Deprecated. Not for use in new websites."> <span class="visually-hidden">Deprecated</span> </abbr></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">eval()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">EvalError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">FinalizationRegistry</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Float16Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Float32Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Float64Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Function</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Generator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">GeneratorFunction</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">globalThis</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Infinity</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Int16Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Int32Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Int8Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">InternalError</a><abbr class="icon icon-nonstandard" title="Non-standard. Check cross-browser support before using."> <span class="visually-hidden">Non-standard</span> </abbr></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Intl</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">isFinite()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">isNaN()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Iterator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">JSON</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Map</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Math</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">NaN</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Number</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Object</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">parseFloat()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">parseInt()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Promise</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Proxy</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Reflect</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RegExp</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Set</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SharedArrayBuffer</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">String</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Symbol</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Temporal</a><abbr class="icon icon-experimental" title="Experimental. Expect behavior to change in the future."> <span class="visually-hidden">Experimental</span> </abbr></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypedArray</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Uint16Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Uint32Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Uint8Array</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Uint8ClampedArray</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">undefined</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">unescape()</a><abbr class="icon icon-deprecated" title="Deprecated. Not for use in new websites."> <span class="visually-hidden">Deprecated</span> </abbr></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">URIError</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">WeakMap</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">WeakRef</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">WeakSet</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Expressions & operators</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Addition?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Addition (+)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Addition_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Addition assignment (+=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Assignment (=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/async_function?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">async function expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/async_function*?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">async function* expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/await?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">await</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise AND (&)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise AND assignment (&=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_NOT?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise NOT (~)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise OR (|)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise OR assignment (|=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_XOR?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise XOR (^)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_XOR_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Bitwise XOR assignment (^=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/class?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">class expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Comma operator (,)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Conditional (ternary) operator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Decrement?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Decrement (--)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/delete?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">delete</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Destructuring assignment</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Division?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Division (/)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Division_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Division assignment (/=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Equality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Equality (==)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Exponentiation (**)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Exponentiation assignment (**=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/function?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">function expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/function*?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">function* expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Greater than (>)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than_or_equal?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Greater than or equal (>=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Grouping?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Grouping operator ( )</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/import.meta?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">import.meta</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/import?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">import()</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/in?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">in</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Increment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Increment (++)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Inequality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Inequality (!=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/instanceof?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">instanceof</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Left_shift?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Left shift (<<)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Left_shift_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Left shift assignment (<<=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Less_than?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Less than (<)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Less_than_or_equal?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Less than or equal (<=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Logical AND (&&)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Logical AND assignment (&&=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Logical_NOT?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Logical NOT (!)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Logical OR (||)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Logical OR assignment (||=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Multiplication?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Multiplication (*)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Multiplication_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Multiplication assignment (*=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/new?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">new</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/new.target?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">new.target</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/null?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">null</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Nullish coalescing assignment (??=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Nullish coalescing operator (??)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Object initializer</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Operator precedence</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Optional chaining (?.)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Property accessors</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Remainder?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Remainder (%)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Remainder_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Remainder assignment (%=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Right_shift?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Right shift (>>)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Right_shift_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Right shift assignment (>>=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Spread syntax (...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Strict equality (===)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Strict_inequality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Strict inequality (!==)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Subtraction?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Subtraction (-)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Subtraction_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Subtraction assignment (-=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/super?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">super</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/this?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">this</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/typeof?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">typeof</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Unary_negation?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Unary negation (-)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Unary_plus?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Unary plus (+)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Unsigned right shift (>>>)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Unsigned right shift assignment (>>>=)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/void?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">void operator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/yield?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">yield</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/yield*?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">yield*</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Statements & declarations</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/async_function?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">async function</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/async_function*?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">async function*</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/block?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Block statement</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/break?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">break</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/class?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">class</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/const?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">const</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/continue?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">continue</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/debugger?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">debugger</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/do...while?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">do...while</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/Empty?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Empty statement</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/export?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">export</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/Expression_statement?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Expression statement</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/for?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">for</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">for await...of</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/for...in?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">for...in</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/for...of?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">for...of</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/function?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">function</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/function*?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">function*</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/if...else?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">if...else</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/import?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">import</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/label?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Labeled statement</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/let?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">let</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/return?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">return</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/switch?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">switch</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/throw?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">throw</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/try...catch?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">try...catch</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/var?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">var</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/while?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">while</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/with?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">with</a><abbr class="icon icon-deprecated" title="Deprecated. Not for use in new websites."> <span class="visually-hidden">Deprecated</span> </abbr></li> </ol> </details></li> <li class="toggle"> <details> <summary>Functions</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Arrow function expressions</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Default parameters</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/get?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">get</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Method definitions</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Rest parameters</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/set?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">set</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/arguments?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">The arguments object</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Classes</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes/constructor?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">constructor</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes/extends?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">extends</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Private properties</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Public class fields</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes/static?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">static</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Static initialization blocks</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Regular expressions</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Backreference?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Backreference: \1, \2</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Capturing_group?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Capturing group: (...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class_escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Character class escape: \d, \D, \w, \W, \s, \S</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Character class: [...], [^...]</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Character escape: \n, \u{...}</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Disjunction?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Disjunction: |</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Input_boundary_assertion?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Input boundary assertion: ^, $</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Literal_character?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Literal character: a, b</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookahead_assertion?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Lookahead assertion: (?=...), (?!...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Lookbehind assertion: (?<=...), (?<!...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Modifier?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Modifier: (?ims-ims:...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Named_backreference?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Named backreference: \k<name></a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Named_capturing_group?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Named capturing group: (?<name>...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Non-capturing_group?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Non-capturing group: (?:...)</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Quantifier?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Quantifier: *, +, ?, {n}, {n,}, {n,m}</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Unicode character class escape: \p{...}, \P{...}</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Wildcard?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Wildcard: .</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Word_boundary_assertion?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Word boundary assertion: \b, \B</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Errors</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Promise_any_all_rejected?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">AggregateError: No Promise in Promise.any was resolved</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Error: Permission denied to access property "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Too_much_recursion?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">InternalError: too much recursion</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_valid_code_point?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: argument is not a valid code point</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_division_by_zero?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: BigInt division by zero</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_negative_exponent?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: BigInt negative exponent</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Form_must_be_one_of?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: form must be one of 'NFC', 'NFD', 'NFKC', or 'NFKD'</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: invalid array length</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_date?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: invalid date</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Precision_range?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: precision is out of range</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_radix?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: radix must be an integer</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Resulting_string_too_large?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: repeat count must be less than infinity</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Negative_repetition_count?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: repeat count must be non-negative</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_be_converted_to_BigInt_because_it_isnt_an_integer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">RangeError: x can't be converted to BigInt because it isn't an integer</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Not_defined?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError: "x" is not defined</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError: assignment to undeclared variable "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError: can't access lexical declaration 'X' before initialization</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_caller_or_arguments_usage?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError: deprecated caller or arguments usage</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Super_not_called?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError: must call super constructor before using 'this' in derived class constructor</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Super_called_twice?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ReferenceError: super() called twice in derived class constructor</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_strict_arguments_eval?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: 'arguments'/'eval' can't be defined or assigned to in strict mode code</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_octal_literal?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: "0"-prefixed octal literals are deprecated</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Strict_non_simple_params?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: "use strict" not allowed in function with non-simple parameters</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Reserved_identifier?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: "x" is a reserved identifier</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_backslash_at_end_of_pattern?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: \ at end of pattern</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_for-of_initializer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: a declaration in the head of a for-of loop can't have an initializer</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Delete_in_strict_mode?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: applying the 'delete' operator to an unqualified name is deprecated</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Arguments_not_allowed?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: arguments is not valid in fields</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_await?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: await is only valid in async functions, async generators and modules</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/await_yield_in_parameter?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: await/yield expression can't be used in parameter</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_use_nullish_coalescing_unparenthesized?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: cannot use `??` unparenthesized within `||` and `&&` expressions</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_character_class_escape_in_class_range?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: character class escape cannot be used in class range in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_continue?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: continue must be inside loop</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_duplicate_capture_group_name?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: duplicate capture group name in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Duplicate_parameter?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: duplicate formal argument x</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_for-in_initializer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: for-in loop head declarations may not have initializers</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Unnamed_function_statement?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: function statement requires a name</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Function_label?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: functions cannot be labelled</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Either_be_both_static_or_non-static?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: getter and setter for private name #x should either be both static or non-static</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Getter_no_arguments?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: getter functions must have no arguments</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Identifier_after_number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: identifier starts immediately after numeric literal</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Illegal_character?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: illegal character</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/import_decl_module_top_level?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: import declarations may only appear at top level of a module</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_incomplete_quantifier?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: incomplete quantifier in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_assignment_left-hand_side?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid assignment left-hand side</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_BigInt_syntax?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid BigInt syntax</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_capture_group_name?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid capture group name in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_char_in_class?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid character in class in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_class_set_operation?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid class set operation in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_decimal_escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid decimal escape in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_identity_escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid identity escape in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_named_capture_reference?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid named capture reference in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_property_name?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid property name in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_range_in_character_class?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid range in character class</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_group?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid regexp group</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_regexp_flag?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid regular expression flag "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_unicode_escape?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: invalid unicode escape in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/JSON_bad_parse?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: JSON.parse: bad parsing</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Label_not_found?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: label not found</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_colon_after_property_id?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing : after property id</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_parenthesis_after_argument_list?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing ) after argument list</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_parenthesis_after_condition?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing ) after condition</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_bracket_after_list?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing ] after element list</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_curly_after_function_body?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing } after function body</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_curly_after_property_list?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing } after property list</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing = in const declaration</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_formal_parameter?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing formal parameter</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Missing_name_after_dot_operator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing name after . operator</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/No_variable_name?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: missing variable name</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_negated_char_class_with_strings?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: negated character class with strings in regular expression</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_new_optional?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: new keyword cannot be used with an optional chain</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_nothing_to_repeat?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: nothing to repeat</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_numbers_out_of_order_in_quantifier?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: numbers out of order in {} quantifier.</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_octal_escape_sequence?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: octal escape sequences can't be used in untagged template literals or in strict mode code</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Parameter_after_rest_parameter?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: parameter after rest parameter</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_delete_private_fields?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: private fields can't be deleted</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Duplicate_proto?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: property name __proto__ appears more than once in object literal</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Regex_raw_bracket?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: raw bracket is not allowed in regular expression with unicode flag</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: redeclaration of formal parameter "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_private_field_or_method?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: reference to undeclared private field or method #x</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Rest_with_default?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: rest parameter may not have a default</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: return not in function</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Setter_one_argument?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: setter functions must have one argument</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/String_literal_EOL?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: string literal contains an unescaped line break</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_super_call?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: super() is only valid in derived class constructors</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_optional_template?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: tagged template cannot be used with optional chain</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Hash_outside_class?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: Unexpected '#' used outside of class body</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_token?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: Unexpected token</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_break?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: unlabeled break must be inside loop or switch</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Unparenthesized_unary_expr_lhs_exponentiation?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: unparenthesized unary expression can't appear on the left-hand side of '**'</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Bad_super_prop?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: use of super property/member accesses only valid within methods or eval code within methods</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_source_map_pragma?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/is_not_iterable?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: 'x' is not iterable</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_type?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: "x" is (not) "y"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_constructor?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: "x" is not a constructor</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_function?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: "x" is not a function</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/No_non-null_object?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: "x" is not a non-null object</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Read-only?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: "x" is read-only</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_not_serializable?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: BigInt value can't be serialized in JSON</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Builtin_ctor_no_new?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: calling a builtin X constructor without new is forbidden</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Get_set_missing_private?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't access/set private field or method: object is not the right class</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_assign_to_property?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't assign to property "x" on "y": not an object</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_convert_BigInt_to_number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't convert BigInt to number</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_convert_x_to_BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't convert x to BigInt</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't define property "x": "obj" is not extensible</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Non_configurable_array_element?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't delete non-configurable array element</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_redefine_property?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't redefine non-configurable property "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_set_prototype?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't set prototype of this object</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_prototype?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: can't set prototype: it would cause a prototype chain cycle</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/in_operator_no_object?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: cannot use 'in' operator to search for 'x' in 'y'</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Class_ctor_no_new?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: class constructors must be invoked with 'new'</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_object_value?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: cyclic object value</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_derived_return?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: derived class constructor returned invalid value x</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Private_setter_only?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: getting private setter-only property</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Private_double_initialization?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: Initializing an object twice is an error with private fields/methods</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/invalid_right_hand_side_instanceof_operand?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: invalid 'instanceof' operand 'x'</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Array_sort_argument?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: invalid Array.prototype.sort argument</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: invalid assignment to const "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Constructor_cant_be_used_directly?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: Iterator/AsyncIterator constructor can't be used directly</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Requires_global_RegExp?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: matchAll/replaceAll must be called with a global RegExp</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/More_arguments_needed?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: More arguments needed</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/No_properties?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: null/undefined has no properties</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Cant_delete?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: property "x" is non-configurable and can't be deleted</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Reduce_of_empty_array_with_no_initial_value?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: Reduce of empty array with no initial value</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: setting getter-only property "x"</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Key_not_weakly_held?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: WeakSet key/WeakMap value 'x' must be an object or an unregistered symbol</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Called_on_incompatible_type?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">TypeError: X.prototype.y called on incompatible type</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">URIError: malformed URI sequence</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Already_has_pragma?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Warning: -file- is being assigned a //# sourceMappingURL, but already has one</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Errors/Stmt_after_return?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Warning: unreachable code after return statement</a></li> </ol> </details></li> <li class="toggle"> <details> <summary>Misc</summary> <ol> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/JavaScript_technologies_overview?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">JavaScript technologies overview</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Lexical_grammar?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Lexical grammar</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Iteration_protocols?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Iteration protocols</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Strict_mode?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Strict mode</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Template_literals?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Template literals</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Trailing_commas?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Trailing commas</a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Deprecated features</a></li> </ol> </details></li> </ol> </div> </div> <section class="place side"></section> </nav> </aside> <div class="toc-container"> <aside class="toc"> <nav> <div class="document-toc-container"> <section class="document-toc"> <header> <h2 class="document-toc-heading">In this article</h2> </header> <ul class="document-toc-list"> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#dynamic_and_weak_typing">Dynamic and weak typing</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#primitive_values">Primitive values</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#objects">Objects</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#type_coercion">Type coercion</a></li> <li class="document-toc-item "><a class="document-toc-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#see_also">See also</a></li> </ul> </section> </div> </nav> </aside> <section class="place side"></section> </div> </div> <main id="content" class="main-content "> <article class="main-page-content" lang="en-US"> <header> <h1>JavaScript data types and data structures</h1> </header> <div class="section-content"> <p>Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures.</p> <p>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Language_overview?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">language overview</a> offers a similar summary of the common data types, but with more comparisons to other languages.</p> </div> <section aria-labelledby="dynamic_and_weak_typing"> <h2 id="dynamic_and_weak_typing"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#dynamic_and_weak_typing">Dynamic and weak typing</a></h2> <div class="section-content"> <p>JavaScript is a <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://en.wikipedia.org/wiki/Dynamic_programming_language" class="external" target="_blank">dynamic</a> language with <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://en.wikipedia.org/wiki/Type_system%23DYNAMIC" class="external" target="_blank">dynamic types</a>. Variables in JavaScript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types:</p> <div class="code-example"> <div class="example-header"> <span class="language-name">js</span> </div> <pre class="brush: js notranslate"><code>let foo = 42; // foo is now a number foo = "bar"; // foo is now a string foo = true; // foo is now a boolean </code></pre> </div> <p>JavaScript is also a <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://en.wikipedia.org/wiki/Strong_and_weak_typing" class="external" target="_blank">weakly typed</a> language, which means it allows implicit type conversion when an operation involves mismatched types, instead of throwing type errors.</p> <div class="code-example"> <div class="example-header"> <span class="language-name">js</span> </div> <pre class="brush: js notranslate"><code>const foo = 42; // foo is a number const result = foo + "1"; // JavaScript coerces foo to a string, so it can be concatenated with the other operand console.log(result); // 421 </code></pre> </div> <p>Implicit coercions are very convenient, but can create subtle bugs when conversions happen where they are not expected, or where they are expected to happen in the other direction (for example, string to number instead of number to string). For <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#symbol_type">symbols</a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_type">BigInts</a>, JavaScript has intentionally disallowed certain implicit type conversions.</p> </div> </section> <section aria-labelledby="primitive_values"> <h2 id="primitive_values"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#primitive_values">Primitive values</a></h2> <div class="section-content"> <p>All types except <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#objects">Object</a> define <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Glossary/Immutable?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">immutable</a> values represented directly at the lowest level of the language. We refer to values of these types as <em>primitive values</em>.</p> <p>All primitive types, except <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/null?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>null</code></a>, can be tested by the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/typeof?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>typeof</code></a> operator. <code>typeof null</code> returns <code>"object"</code>, so one has to use <code>=== null</code> to test for <code>null</code>.</p> <p>All primitive types, except <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/null?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>null</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>undefined</code></a>, have their corresponding object wrapper types, which provide useful methods for working with the primitive values. For example, the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number</code></a> object provides methods like <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>toExponential()</code></a>. When a property is accessed on a primitive value, JavaScript automatically wraps the value into the corresponding wrapper object and accesses the property on the object instead. However, accessing a property on <code>null</code> or <code>undefined</code> throws a <code>TypeError</code> exception, which necessitates the introduction of the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">optional chaining</a> operator.</p> <figure class="table-container"> <table> <thead> <tr> <th>Type</th> <th><code>typeof</code> return value</th> <th>Object wrapper</th> </tr> </thead> <tbody> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#null_type">Null</a></td> <td><code>"object"</code></td> <td>N/A</td> </tr> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#undefined_type">Undefined</a></td> <td><code>"undefined"</code></td> <td>N/A</td> </tr> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#boolean_type">Boolean</a></td> <td><code>"boolean"</code></td> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Boolean</code></a></td> </tr> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_type">Number</a></td> <td><code>"number"</code></td> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number</code></a></td> </tr> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_type">BigInt</a></td> <td><code>"bigint"</code></td> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>BigInt</code></a></td> </tr> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_type">String</a></td> <td><code>"string"</code></td> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>String</code></a></td> </tr> <tr> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#symbol_type">Symbol</a></td> <td><code>"symbol"</code></td> <td><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Symbol</code></a></td> </tr> </tbody> </table> </figure> <p>The object wrapper classes' reference pages contain more information about the methods and properties available for each type, as well as detailed descriptions for the semantics of the primitive types themselves.</p> </div> </section> <section aria-labelledby="null_type"> <h3 id="null_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#null_type">Null type</a></h3> <div class="section-content"> <p>The Null type is inhabited by exactly one value: <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/null?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>null</code></a>.</p> </div> </section> <section aria-labelledby="undefined_type"> <h3 id="undefined_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#undefined_type">Undefined type</a></h3> <div class="section-content"> <p>The Undefined type is inhabited by exactly one value: <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>undefined</code></a>.</p> <p>Conceptually, <code>undefined</code> indicates the absence of a <em>value</em>, while <code>null</code> indicates the absence of an <em>object</em> (which could also make up an excuse for <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/typeof?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#typeof_null"><code>typeof null === "object"</code></a>). The language usually defaults to <code>undefined</code> when something is devoid of a value:</p> <ul> <li>A <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/return?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>return</code></a> statement with no value (<code>return;</code>) implicitly returns <code>undefined</code>.</li> <li>Accessing a nonexistent <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">object</a> property (<code>obj.iDontExist</code>) returns <code>undefined</code>.</li> <li>A variable declaration without initialization (<code>let x;</code>) implicitly initializes the variable to <code>undefined</code>.</li> <li>Many methods, such as <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Array.prototype.find()</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Map.prototype.get()</code></a>, return <code>undefined</code> when no element is found.</li> </ul> <p><code>null</code> is used much less often in the core language. The most important place is the end of the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">prototype chain</a> — subsequently, methods that interact with prototypes, such as <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Object.getPrototypeOf()</code></a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Object.create()</code></a>, etc., accept or return <code>null</code> instead of <code>undefined</code>.</p> <p><code>null</code> is a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Lexical_grammar?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#keywords">keyword</a>, but <code>undefined</code> is a normal <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Lexical_grammar?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#identifiers">identifier</a> that happens to be a global property. In practice, the difference is minor, since <code>undefined</code> should not be redefined or shadowed.</p> </div> </section> <section aria-labelledby="boolean_type"> <h3 id="boolean_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#boolean_type">Boolean type</a></h3> <div class="section-content"> <p>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Boolean</code></a> type represents a logical entity and is inhabited by two values: <code>true</code> and <code>false</code>.</p> <p>Boolean values are usually used for conditional operations, including <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">ternary operators</a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/if...else?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>if...else</code></a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/while?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>while</code></a>, etc.</p> </div> </section> <section aria-labelledby="number_type"> <h3 id="number_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_type">Number type</a></h3> <div class="section-content"> <p>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number</code></a> type is a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_encoding">double-precision 64-bit binary format IEEE 754 value</a>. It is capable of storing positive floating-point numbers between 2<sup>-1074</sup> (<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MIN_VALUE</code></a>) and 2<sup>1023</sup> × (2 - 2<sup>-52</sup>) (<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MAX_VALUE</code></a>) as well as negative floating-point numbers of the same magnitude, but it can only safely store integers in the range -(2<sup>53</sup> − 1) (<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MIN_SAFE_INTEGER</code></a>) to 2<sup>53</sup> − 1 (<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MAX_SAFE_INTEGER</code></a>). Outside this range, JavaScript can no longer safely represent integers; they will instead be represented by a double-precision floating point approximation. You can check if a number is within the range of safe integers using <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.isSafeInteger()</code></a>.</p> <p>Values outside the representable range are automatically converted:</p> <ul> <li>Positive values greater than <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MAX_VALUE</code></a> are converted to <code>+Infinity</code>.</li> <li>Positive values smaller than <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MIN_VALUE</code></a> are converted to <code>+0</code>.</li> <li>Negative values smaller than -<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MAX_VALUE</code></a> are converted to <code>-Infinity</code>.</li> <li>Negative values greater than -<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MIN_VALUE</code></a> are converted to <code>-0</code>.</li> </ul> <p><code>+Infinity</code> and <code>-Infinity</code> behave similarly to mathematical infinity, but with some slight differences; see <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.POSITIVE_INFINITY</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.NEGATIVE_INFINITY</code></a> for details.</p> <p>The Number type has only one value with multiple representations: <code>0</code> is represented as both <code>-0</code> and <code>+0</code> (where <code>0</code> is an alias for <code>+0</code>). In practice, there is almost no difference between the different representations; for example, <code>+0 === -0</code> is <code>true</code>. However, you are able to notice this when you divide by zero:</p> <div class="code-example"> <div class="example-header"> <span class="language-name">js</span> </div> <pre class="brush: js notranslate"><code>console.log(42 / +0); // Infinity console.log(42 / -0); // -Infinity </code></pre> </div> <p><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>NaN</code></a> ("<strong>N</strong>ot <strong>a</strong> <strong>N</strong>umber") is a special kind of number value that's typically encountered when the result of an arithmetic operation cannot be expressed as a number. It is also the only value in JavaScript that is not equal to itself.</p> <p>Although a number is conceptually a "mathematical value" and is always implicitly floating-point-encoded, JavaScript provides <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bitwise_operators">bitwise operators</a>. When applying bitwise operators, the number is first converted to a 32-bit integer.</p> <div class="notecard note"> <p><strong>Note:</strong> Although bitwise operators <em>can</em> be used to represent several Boolean values within a single number using <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://en.wikipedia.org/wiki/Mask_%2528computing%2529" class="external" target="_blank">bit masking</a>, this is usually considered a bad practice. JavaScript offers other means to represent a set of Booleans (like an array of Booleans, or an object with Boolean values assigned to named properties). Bit masking also tends to make the code more difficult to read, understand, and maintain.</p> </div> <p>It may be necessary to use such techniques in very constrained environments, like when trying to cope with the limitations of local storage, or in extreme cases (such as when each bit over the network counts). This technique should only be considered when it is the last measure that can be taken to optimize size.</p> </div> </section> <section aria-labelledby="bigint_type"> <h3 id="bigint_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_type">BigInt type</a></h3> <div class="section-content"> <p>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>BigInt</code></a> type is a numeric primitive in JavaScript that can represent integers with arbitrary magnitude. With BigInts, you can safely store and operate on large integers even beyond the safe integer limit (<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MAX_SAFE_INTEGER</code></a>) for Numbers.</p> <p>A BigInt is created by appending <code>n</code> to the end of an integer or by calling the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>BigInt()</code></a> function.</p> <p>This example demonstrates where incrementing the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Number.MAX_SAFE_INTEGER</code></a> returns the expected result:</p> <div class="code-example"> <div class="example-header"> <span class="language-name">js</span> </div> <pre class="brush: js notranslate"><code>// BigInt const x = BigInt(Number.MAX_SAFE_INTEGER); // 9007199254740991n x + 1n === x + 2n; // false because 9007199254740992n and 9007199254740993n are unequal // Number Number.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2; // true because both are 9007199254740992 </code></pre> </div> <p>You can use most operators to work with BigInts, including <code>+</code>, <code>*</code>, <code>-</code>, <code>**</code>, and <code>%</code> — the only forbidden one is <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>>>></code></a>. A BigInt is not <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">strictly equal</a> to a Number with the same mathematical value, but it is <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Equality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">loosely</a> so.</p> <p>BigInt values are neither always more precise nor always less precise than numbers, since BigInts cannot represent fractional numbers, but can represent big integers more accurately. Neither type entails the other, and they are not mutually substitutable. A <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>TypeError</code></a> is thrown if BigInt values are mixed with regular numbers in arithmetic expressions, or if they are <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_coercion">implicitly converted</a> to each other.</p> </div> </section> <section aria-labelledby="string_type"> <h3 id="string_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_type">String type</a></h3> <div class="section-content"> <p>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>String</code></a> type represents textual data and is encoded as a sequence of 16-bit unsigned integer values representing <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#utf-16_characters_unicode_code_points_and_grapheme_clusters">UTF-16 code units</a>. Each element in the string occupies a position in the string. The first element is at index <code>0</code>, the next at index <code>1</code>, and so on. The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">length</a> of a string is the number of UTF-16 code units in it, which may not correspond to the actual number of Unicode characters; see the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#utf-16_characters_unicode_code_points_and_grapheme_clusters"><code>String</code></a> reference page for more details.</p> <p>JavaScript strings are immutable. This means that once a string is created, it is not possible to modify it. String methods create new strings based on the content of the current string — for example:</p> <ul> <li>A substring of the original using <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>substring()</code></a>.</li> <li>A concatenation of two strings using the concatenation operator (<code>+</code>) or <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>concat()</code></a>.</li> </ul> <h4 id="beware_of_stringly-typing_your_code!">Beware of "stringly-typing" your code!</h4> <p>It can be tempting to use strings to represent complex data. Doing this comes with short-term benefits:</p> <ul> <li>It is easy to build complex strings with concatenation.</li> <li>Strings are easy to debug (what you see printed is always what is in the string).</li> <li>Strings are the common denominator of a lot of APIs (<a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/API/HTMLInputElement?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">input fields</a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/API/Web_Storage_API?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">local storage</a> values, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/API/Window/fetch?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>fetch()</code></a> responses when using <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/API/Response/text?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Response.text()</code></a>, etc.) and it can be tempting to only work with strings.</li> </ul> <p>With conventions, it is possible to represent any data structure in a string. This does not make it a good idea. For instance, with a separator, one could emulate a list (while a JavaScript array would be more suitable). Unfortunately, when the separator is used in one of the "list" elements, then, the list is broken. An escape character can be chosen, etc. All of this requires conventions and creates an unnecessary maintenance burden.</p> <p>Use strings for textual data. When representing complex data, <em>parse</em> strings, and use the appropriate abstraction.</p> </div> </section> <section aria-labelledby="symbol_type"> <h3 id="symbol_type"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#symbol_type">Symbol type</a></h3> <div class="section-content"> <p>A <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Symbol</code></a> is a <strong>unique</strong> and <strong>immutable</strong> primitive value and may be used as the key of an Object property (see below). In some programming languages, Symbols are called "atoms". The purpose of symbols is to create unique property keys that are guaranteed not to clash with keys from other code.</p> </div> </section> <section aria-labelledby="objects"> <h2 id="objects"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#objects">Objects</a></h2> <div class="section-content"> <p>In computer science, an object is a value in memory which is possibly referenced by an <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Glossary/Identifier?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">identifier</a>. In JavaScript, objects are the only <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Glossary/Mutable?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">mutable</a> values. <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Functions</a> are, in fact, also objects with the additional capability of being <em>callable</em>.</p> </div> </section> <section aria-labelledby="properties"> <h3 id="properties"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#properties">Properties</a></h3> <div class="section-content"> <p>In JavaScript, objects can be seen as a collection of properties. With the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Grammar_and_types?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#object_literals">object literal syntax</a>, a limited set of properties are initialized; then properties can be added and removed. Object properties are equivalent to key-value pairs. Property keys are either <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_type">strings</a> or <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#symbol_type">symbols</a>. When other types (such as numbers) are used to index objects, the values are implicitly converted to strings. Property values can be values of any type, including other objects, which enables building complex data structures.</p> <p>There are two types of object properties: The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#data_property"><em>data</em> property</a> and the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#accessor_property"><em>accessor</em> property</a>. Each property has corresponding <em>attributes</em>. Each attribute is accessed internally by the JavaScript engine, but you can set them through <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Object.defineProperty()</code></a>, or read them through <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Object.getOwnPropertyDescriptor()</code></a>. You can read more about the various nuances on the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Object.defineProperty()</code></a> page.</p> <h4 id="data_property">Data property</h4> <p>Data properties associate a key with a value. It can be described by the following attributes:</p> <dl> <dt id="value"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#value"><code>value</code></a> </dt> <dd> <p>The value retrieved by a get access of the property. Can be any JavaScript value.</p> </dd> <dt id="writable"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#writable"><code>writable</code></a> </dt> <dd> <p>A boolean value indicating if the property can be changed with an assignment.</p> </dd> <dt id="enumerable"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#enumerable"><code>enumerable</code></a> </dt> <dd> <p>A boolean value indicating if the property can be enumerated by a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/for...in?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>for...in</code></a> loop. See also <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Enumerability and ownership of properties</a> for how enumerability interacts with other functions and syntaxes.</p> </dd> <dt id="configurable"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#configurable"><code>configurable</code></a> </dt> <dd> <p>A boolean value indicating if the property can be deleted, can be changed to an accessor property, and can have its attributes changed.</p> </dd> </dl> <h4 id="accessor_property">Accessor property</h4> <p>Associates a key with one of two accessor functions (<code>get</code> and <code>set</code>) to retrieve or store a value.</p> <div class="notecard note"> <p><strong>Note:</strong> It's important to recognize it's accessor <em>property</em> — not accessor <em>method</em>. We can give a JavaScript object class-like accessors by using a function as a value — but that doesn't make the object a class.</p> </div> <p>An accessor property has the following attributes:</p> <dl> <dt id="get"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#get"><code>get</code></a> </dt> <dd> <p>A function called with an empty argument list to retrieve the property value whenever a get access to the value is performed. See also <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/get?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">getters</a>. May be <code>undefined</code>.</p> </dd> <dt id="set"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#set"><code>set</code></a> </dt> <dd> <p>A function called with an argument that contains the assigned value. Executed whenever a specified property is attempted to be changed. See also <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Functions/set?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">setters</a>. May be <code>undefined</code>.</p> </dd> <dt id="enumerable_2"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#enumerable_2"><code>enumerable</code></a> </dt> <dd> <p>A boolean value indicating if the property can be enumerated by a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Statements/for...in?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>for...in</code></a> loop. See also <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Enumerability and ownership of properties</a> for how enumerability interacts with other functions and syntaxes.</p> </dd> <dt id="configurable_2"> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#configurable_2"><code>configurable</code></a> </dt> <dd> <p>A boolean value indicating if the property can be deleted, can be changed to a data property, and can have its attributes changed.</p> </dd> </dl> <p>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">prototype</a> of an object points to another object or to <code>null</code> — it's conceptually a hidden property of the object, commonly represented as <code>[[Prototype]]</code>. Properties of the object's <code>[[Prototype]]</code> can also be accessed on the object itself.</p> <p>Objects are ad-hoc key-value pairs, so they are often used as maps. However, there can be ergonomics, security, and performance issues. Use a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Map</code></a> for storing arbitrary data instead. The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#objects_vs._maps"><code>Map</code> reference</a> contains a more detailed discussion of the pros & cons between plain objects and maps for storing key-value associations.</p> </div> </section> <section aria-labelledby="dates"> <h3 id="dates"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#dates">Dates</a></h3> <div class="section-content"> <p>JavaScript provides two sets of APIs for representing dates: the legacy <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Date</code></a> object and the modern <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Temporal</code></a> object. <code>Date</code> has many undesirable design choices and should be avoided in new code if possible.</p> </div> </section> <section aria-labelledby="indexed_collections_arrays_and_typed_arrays"> <h3 id="indexed_collections_arrays_and_typed_arrays"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#indexed_collections_arrays_and_typed_arrays">Indexed collections: Arrays and typed Arrays</a></h3> <div class="section-content"> <p><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Arrays</a> are regular objects for which there is a particular relationship between integer-keyed properties and the <code>length</code> property.</p> <p>Additionally, arrays inherit from <code>Array.prototype</code>, which provides a handful of convenient methods to manipulate arrays. For example, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>indexOf()</code></a> searches a value in the array and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>push()</code></a> appends an element to the array. This makes Arrays a perfect candidate to represent ordered lists.</p> <p><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Typed_arrays?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Typed Arrays</a> present an array-like view of an underlying binary data buffer, and offer many methods that have similar semantics to the array counterparts. "Typed array" is an umbrella term for a range of data structures, including <code>Int8Array</code>, <code>Float32Array</code>, etc. Check the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Guide/Typed_arrays?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">typed array</a> page for more information. Typed arrays are often used in conjunction with <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>ArrayBuffer</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>DataView</code></a>.</p> </div> </section> <section aria-labelledby="keyed_collections_maps_sets_weakmaps_weaksets"> <h3 id="keyed_collections_maps_sets_weakmaps_weaksets"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#keyed_collections_maps_sets_weakmaps_weaksets">Keyed collections: Maps, Sets, WeakMaps, WeakSets</a></h3> <div class="section-content"> <p>These data structures take object references as keys. <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Set</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>WeakSet</code></a> represent a collection of unique values, while <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Map</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>WeakMap</code></a> represent a collection of key-value associations.</p> <p>You could implement <code>Map</code>s and <code>Set</code>s yourself. However, since objects cannot be compared (in the sense of <code><</code> "less than", for instance), neither does the engine expose its hash function for objects, look-up performance would necessarily be linear. Native implementations of them (including <code>WeakMap</code>s) can have look-up performance that is approximately logarithmic to constant time.</p> <p>Usually, to bind data to a DOM node, one could set properties directly on the object, or use <code>data-*</code> attributes. This has the downside that the data is available to any script running in the same context. <code>Map</code>s and <code>WeakMap</code>s make it easy to <em>privately</em> bind data to an object.</p> <p><code>WeakMap</code> and <code>WeakSet</code> only allow garbage-collectable values as keys, which are either objects or <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#shared_symbols_in_the_global_symbol_registry">non-registered symbols</a>, and the keys may be collected even when they remain in the collection. They are specifically used for <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Memory_management?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#data_structures_aiding_memory_management">memory usage optimization</a>.</p> </div> </section> <section aria-labelledby="structured_data_json"> <h3 id="structured_data_json"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#structured_data_json">Structured data: JSON</a></h3> <div class="section-content"> <p>JSON (<strong>J</strong>ava<strong>S</strong>cript <strong>O</strong>bject <strong>N</strong>otation) is a lightweight data-interchange format, derived from JavaScript, but used by many programming languages. JSON builds universal data structures that can be transferred between different environments and even across languages. See <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>JSON</code></a> for more details.</p> </div> </section> <section aria-labelledby="more_objects_in_the_standard_library"> <h3 id="more_objects_in_the_standard_library"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#more_objects_in_the_standard_library">More objects in the standard library</a></h3> <div class="section-content"> <p>JavaScript has a standard library of built-in objects. Read the <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">reference</a> to find out more about the built-in objects.</p> </div> </section> <section aria-labelledby="type_coercion"> <h2 id="type_coercion"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#type_coercion">Type coercion</a></h2> <div class="section-content"> <p>As mentioned above, JavaScript is a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#dynamic_and_weak_typing">weakly typed</a> language. This means that you can often use a value of one type where another type is expected, and the language will convert it to the right type for you. To do so, JavaScript defines a handful of coercion rules.</p> </div> </section> <section aria-labelledby="primitive_coercion"> <h3 id="primitive_coercion"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#primitive_coercion">Primitive coercion</a></h3> <div class="section-content"> <p>The <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://tc39.es/ecma262/multipage/abstract-operations.html%23sec-toprimitive" class="external" target="_blank">primitive coercion</a> process is used where a primitive value is expected, but there's no strong preference for what the actual type should be. This is usually when a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_type">string</a>, a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_type">number</a>, or a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_type">BigInt</a> are equally acceptable. For example:</p> <ul> <li>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Date()</code></a> constructor, when it receives one argument that's not a <code>Date</code> instance — strings represent date strings, while numbers represent timestamps.</li> <li>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Addition?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>+</code></a> operator — if one operand is a string, string concatenation is performed; otherwise, numeric addition is performed.</li> <li>The <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Equality?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>==</code></a> operator — if one operand is a primitive while the other is an object, the object is converted to a primitive value with no preferred type.</li> </ul> <p>This operation does not do any conversion if the value is already a primitive. Objects are converted to primitives by calling its <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>[Symbol.toPrimitive]()</code></a> (with <code>"default"</code> as hint), <code>valueOf()</code>, and <code>toString()</code> methods, in that order. Note that primitive conversion calls <code>valueOf()</code> before <code>toString()</code>, which is similar to the behavior of <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_coercion">number coercion</a> but different from <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_coercion">string coercion</a>.</p> <p>The <code>[Symbol.toPrimitive]()</code> method, if present, must return a primitive — returning an object results in a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>TypeError</code></a>. For <code>valueOf()</code> and <code>toString()</code>, if one returns an object, the return value is ignored and the other's return value is used instead; if neither is present, or neither returns a primitive, a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>TypeError</code></a> is thrown. For example, in the following code:</p> <div class="code-example"> <div class="example-header"> <span class="language-name">js</span> </div> <pre class="brush: js notranslate"><code>console.log({} + []); // "[object Object]" </code></pre> </div> <p>Neither <code>{}</code> nor <code>[]</code> have a <code>[Symbol.toPrimitive]()</code> method. Both <code>{}</code> and <code>[]</code> inherit <code>valueOf()</code> from <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Object.prototype.valueOf</code></a>, which returns the object itself. Since the return value is an object, it is ignored. Therefore, <code>toString()</code> is called instead. <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>{}.toString()</code></a> returns <code>"[object Object]"</code>, while <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>[].toString()</code></a> returns <code>""</code>, so the result is their concatenation: <code>"[object Object]"</code>.</p> <p>The <code>[Symbol.toPrimitive]()</code> method always takes precedence when doing conversion to any primitive type. Primitive conversion generally behaves like number conversion, because <code>valueOf()</code> is called in priority; however, objects with custom <code>[Symbol.toPrimitive]()</code> methods can choose to return any primitive. <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Date</code></a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Symbol</code></a> objects are the only built-in objects that override the <code>[Symbol.toPrimitive]()</code> method. <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Symbol.toPrimitive?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Date.prototype[Symbol.toPrimitive]()</code></a> treats the <code>"default"</code> hint as if it's <code>"string"</code>, while <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol.toPrimitive?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Symbol.prototype[Symbol.toPrimitive]()</code></a> ignores the hint and always returns a symbol.</p> </div> </section> <section aria-labelledby="numeric_coercion"> <h3 id="numeric_coercion"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#numeric_coercion">Numeric coercion</a></h3> <div class="section-content"> <p>There are two numeric types: <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_type">Number</a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_type">BigInt</a>. Sometimes the language specifically expects a number or a BigInt (such as <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>Array.prototype.slice()</code></a>, where the index must be a number); other times, it may tolerate either and perform different operations depending on the operand's type. For strict coercion processes that do not allow implicit conversion from the other type, see <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_coercion">number coercion</a> and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_coercion">BigInt coercion</a>.</p> <p>Numeric coercion is nearly the same as <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_coercion">number coercion</a>, except that BigInts are returned as-is instead of causing a <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB"><code>TypeError</code></a>. Numeric coercion is used by all arithmetic operators, since they are overloaded for both numbers and BigInts. The only exception is <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Operators/Unary_plus?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">unary plus</a>, which always does number coercion.</p> </div> </section> <section aria-labelledby="other_coercions"> <h3 id="other_coercions"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#other_coercions">Other coercions</a></h3> <div class="section-content"> <p>All data types, except Null, Undefined, and Symbol, have their respective coercion process. See <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_coercion">string coercion</a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#boolean_coercion">boolean coercion</a>, and <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#object_coercion">object coercion</a> for more details.</p> <p>As you may have noticed, there are three distinct paths through which objects may be converted to primitives:</p> <ul> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#primitive_coercion">Primitive coercion</a>: <code>[Symbol.toPrimitive]("default")</code> → <code>valueOf()</code> → <code>toString()</code></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#numeric_coercion">Numeric coercion</a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#number_coercion">number coercion</a>, <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#bigint_coercion">BigInt coercion</a>: <code>[Symbol.toPrimitive]("number")</code> → <code>valueOf()</code> → <code>toString()</code></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Reference/Global_Objects/String?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#string_coercion">String coercion</a>: <code>[Symbol.toPrimitive]("string")</code> → <code>toString()</code> → <code>valueOf()</code></li> </ul> <p>In all cases, <code>[Symbol.toPrimitive]()</code>, if present, must be callable and return a primitive, while <code>valueOf</code> or <code>toString</code> will be ignored if they are not callable or return an object. At the end of the process, if successful, the result is guaranteed to be a primitive. The resulting primitive is then subject to further coercions depending on the context.</p> </div> </section> <section aria-labelledby="see_also"> <h2 id="see_also"><a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB#see_also">See also</a></h2> <div class="section-content"> <ul> <li><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/trekhleb/javascript-algorithms" class="external" target="_blank">JavaScript Data Structures and Algorithms</a> by Oleksii Trekhleb</li> <li><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/humanwhocodes/computer-science-in-javascript" class="external" target="_blank">Computer Science in JavaScript</a> by Nicholas C. Zakas</li> </ul> </div> </section> </article> <aside class="article-footer"> <div class="article-footer-inner"> <div class="svg-container"> <svg xmlns="http://www.w3.org/2000/svg" width="162" height="162" viewbox="0 0 162 162" fill="none" role="none"> <mask id="b" fill="#fff"> <path d="M97.203 47.04c8.113-7.886 18.004-13.871 28.906-17.492a78 78 0 0 1 33.969-3.39c11.443 1.39 22.401 5.295 32.024 11.411s17.656 14.28 23.476 23.86c5.819 9.579 9.269 20.318 10.083 31.385a69.85 69.85 0 0 1-5.387 32.44c-4.358 10.272-11.115 19.443-19.747 26.801-8.632 7.359-18.908 12.709-30.034 15.637l-6.17-21.698c7.666-2.017 14.746-5.703 20.694-10.773 5.948-5.071 10.603-11.389 13.606-18.467a48.14 48.14 0 0 0 3.712-22.352c-.561-7.625-2.938-15.025-6.948-21.625s-9.544-12.226-16.175-16.44-14.181-6.904-22.065-7.863a53.75 53.75 0 0 0-23.405 2.336c-7.513 2.495-14.327 6.62-19.918 12.053z"></path> </mask><path stroke="url(#a)" stroke-dasharray="6, 6" stroke-width="2" d="M97.203 47.04c8.113-7.886 18.004-13.871 28.906-17.492a78 78 0 0 1 33.969-3.39c11.443 1.39 22.401 5.295 32.024 11.411s17.656 14.28 23.476 23.86c5.819 9.579 9.269 20.318 10.083 31.385a69.85 69.85 0 0 1-5.387 32.44c-4.358 10.272-11.115 19.443-19.747 26.801-8.632 7.359-18.908 12.709-30.034 15.637l-6.17-21.698c7.666-2.017 14.746-5.703 20.694-10.773 5.948-5.071 10.603-11.389 13.606-18.467a48.14 48.14 0 0 0 3.712-22.352c-.561-7.625-2.938-15.025-6.948-21.625s-9.544-12.226-16.175-16.44-14.181-6.904-22.065-7.863a53.75 53.75 0 0 0-23.405 2.336c-7.513 2.495-14.327 6.62-19.918 12.053z" mask="url(#b)" style="stroke:url(#a)" transform="translate(-63.992 -25.587)"></path><ellipse cx="8.066" cy="111.597" fill="var(--background-tertiary)" rx="53.677" ry="53.699" transform="matrix(.71707 -.697 .7243 .6895 0 0)"></ellipse><g clip-path="url(#c)" transform="translate(-63.992 -25.587)"> <path fill="#9abff5" d="m144.256 137.379 32.906 12.434a4.41 4.41 0 0 1 2.559 5.667l-9.326 24.679a4.41 4.41 0 0 1-5.667 2.559l-8.226-3.108-2.332 6.17c-.466 1.233-.375 1.883-1.609 1.417l-2.253-.527c-.411-.155-.95-.594-1.206-1.161l-4.734-10.484-12.545-4.741a4.41 4.41 0 0 1-2.559-5.667l9.325-24.679a4.41 4.41 0 0 1 5.667-2.559m9.961 29.617 8.227 3.108 3.264-8.638-.498-6.768-4.113-1.555.548 7.258-4.319-1.632zm-12.339-4.663 8.226 3.108 3.264-8.637-.498-6.769-4.113-1.554.548 7.257-4.319-1.632z"></path> </g><g clip-path="url(#d)" transform="translate(-63.992 -25.587)"> <path fill="#81b0f3" d="M135.35 60.136 86.67 41.654c-3.346-1.27-7.124.428-8.394 3.775L64.414 81.938c-1.27 3.347.428 7.125 3.774 8.395l12.17 4.62-3.465 9.128c-.693 1.826-1.432 2.457.394 3.15l3.014 1.625c.609.231 1.637.274 2.477-.104l15.53-6.983 18.56 7.047c3.346 1.27 7.124-.428 8.395-3.775l13.862-36.51c1.27-3.346-.428-7.124-3.775-8.395M95.261 83.207l-12.17-4.62 4.852-12.779 7.19-7.017 6.085 2.31-7.725 7.51 6.389 2.426zm18.255 6.93-12.17-4.62 4.852-12.778 7.189-7.017 6.085 2.31-7.725 7.51 6.39 2.426z"></path> </g><defs> <clippath id="c"> <path fill="#fff" d="m198.638 146.586-65.056-24.583-24.583 65.057 65.056 24.582z"></path> </clippath> <clippath id="d"> <path fill="#fff" d="m66.438 14.055 96.242 36.54-36.54 96.243-96.243-36.54z"></path> </clippath> <lineargradient id="a" x1="97.203" x2="199.995" y1="47.04" y2="152.793" gradientunits="userSpaceOnUse"> <stop stop-color="#086DFC"></stop> <stop offset="0.246" stop-color="#2C81FA"></stop> <stop offset="0.516" stop-color="#5497F8"></stop> <stop offset="0.821" stop-color="#80B0F6"></stop> <stop offset="1" stop-color="#9ABFF5"></stop> </lineargradient> </defs> </svg> </div> <h2>Help improve MDN</h2> <fieldset class="feedback"> <label>Was this page helpful to you?</label> <div class="button-container"> <button type="button" class="button primary has-icon yes"><span class="button-wrap"><span class="icon icon-thumbs-up "></span>Yes</span></button><button type="button" class="button primary has-icon no"><span class="button-wrap"><span class="icon icon-thumbs-down "></span>No</span></button> </div> </fieldset><a class="contribute" href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/mdn/content/blob/main/CONTRIBUTING.md" title="This will take you to our contribution guidelines on GitHub." target="_blank" rel="noopener noreferrer">Learn how to contribute</a>. <p class="last-modified-date">This page was last modified on<!-- --> <time datetime="2025-01-20T22:28:20.000Z">Jan 20, 2025</time> by<!-- --> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/Web/JavaScript/Data_structures/contributors.txt?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" rel="nofollow">MDN contributors</a>.</p> <div id="on-github" class="on-github"> <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/mdn/content/blob/main/files/en-us/web/javascript/data_structures/index.md?plain%3D1" title="Folder: en-us/web/javascript/data_structures (Opens in a new tab)" target="_blank" rel="noopener noreferrer">View this page on GitHub</a> <!-- -->•<!-- --> <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/mdn/content/issues/new?template%3Dpage-report.yml%26mdn-url%3Dhttps%253A%252F%252Fdeveloper.mozilla.org%252Fen-US%252Fdocs%252FWeb%252FJavaScript%252FData_structures%26metadata%3D%253C%2521--%2BDo%2Bnot%2Bmake%2Bchanges%2Bbelow%2Bthis%2Bline%2B--%253E%250A%253Cdetails%253E%250A%253Csummary%253EPage%2Breport%2Bdetails%253C%252Fsummary%253E%250A%250A*%2BFolder%253A%2B%2560en-us%252Fweb%252Fjavascript%252Fdata_structures%2560%250A*%2BMDN%2BURL%253A%2Bhttps%253A%252F%252Fdeveloper.mozilla.org%252Fen-US%252Fdocs%252FWeb%252FJavaScript%252FData_structures%250A*%2BGitHub%2BURL%253A%2Bhttps%253A%252F%252Fgithub.com%252Fmdn%252Fcontent%252Fblob%252Fmain%252Ffiles%252Fen-us%252Fweb%252Fjavascript%252Fdata_structures%252Findex.md%250A*%2BLast%2Bcommit%253A%2Bhttps%253A%252F%252Fgithub.com%252Fmdn%252Fcontent%252Fcommit%252Fa4e9bce1e8bac1b845b32536e0e44f335233eab6%250A*%2BDocument%2Blast%2Bmodified%253A%2B2025-01-20T22%253A28%253A20.000Z%250A%250A%253C%252Fdetails%253E" title="This will take you to GitHub to file a new issue." target="_blank" rel="noopener noreferrer">Report a problem with this content</a> </div> </div> </aside> </main> </div> </div> <footer id="nav-footer" class="page-footer"> <div class="page-footer-grid"> <div class="page-footer-logo-col"> <a href="https://developer-mozilla-org.translate.goog/?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" class="mdn-footer-logo" aria-label="MDN homepage"> <svg width="48" height="17" viewbox="0 0 48 17" fill="none" xmlns="http://www.w3.org/2000/svg"> <title id="mdn-footer-logo-svg">MDN logo</title><path d="M20.04 16.512H15.504V10.416C15.504 9.488 15.344 8.824 15.024 8.424C14.72 8.024 14.264 7.824 13.656 7.824C12.92 7.824 12.384 8.064 12.048 8.544C11.728 9.024 11.568 9.64 11.568 10.392V14.184H13.008V16.512H8.472V10.416C8.472 9.488 8.312 8.824 7.992 8.424C7.688 8.024 7.232 7.824 6.624 7.824C5.872 7.824 5.336 8.064 5.016 8.544C4.696 9.024 4.536 9.64 4.536 10.392V14.184H6.6V16.512H0V14.184H1.44V8.04H0.024V5.688H4.536V7.32C5.224 6.088 6.32 5.472 7.824 5.472C8.608 5.472 9.328 5.664 9.984 6.048C10.64 6.432 11.096 7.016 11.352 7.8C11.992 6.248 13.168 5.472 14.88 5.472C15.856 5.472 16.72 5.776 17.472 6.384C18.224 6.992 18.6 7.936 18.6 9.216V14.184H20.04V16.512Z" fill="currentColor"></path><path d="M33.6714 16.512H29.1354V14.496C28.8314 15.12 28.3834 15.656 27.7914 16.104C27.1994 16.536 26.4154 16.752 25.4394 16.752C24.0154 16.752 22.8954 16.264 22.0794 15.288C21.2634 14.312 20.8554 12.984 20.8554 11.304C20.8554 9.688 21.2554 8.312 22.0554 7.176C22.8554 6.04 24.0634 5.472 25.6794 5.472C26.5594 5.472 27.2794 5.648 27.8394 6C28.3994 6.352 28.8314 6.8 29.1354 7.344V2.352H26.9754V0H32.2314V14.184H33.6714V16.512ZM29.1354 11.04V10.776C29.1354 9.88 28.8954 9.184 28.4154 8.688C27.9514 8.176 27.3674 7.92 26.6634 7.92C25.9754 7.92 25.3674 8.176 24.8394 8.688C24.3274 9.2 24.0714 10.008 24.0714 11.112C24.0714 12.152 24.3114 12.944 24.7914 13.488C25.2714 14.032 25.8394 14.304 26.4954 14.304C27.3114 14.304 27.9514 13.96 28.4154 13.272C28.8954 12.584 29.1354 11.84 29.1354 11.04Z" fill="currentColor"></path><path d="M47.9589 16.512H41.9829V14.184H43.4229V10.416C43.4229 9.488 43.2629 8.824 42.9429 8.424C42.6389 8.024 42.1829 7.824 41.5749 7.824C40.8389 7.824 40.2709 8.056 39.8709 8.52C39.4709 8.968 39.2629 9.56 39.2469 10.296V14.184H40.6869V16.512H34.7109V14.184H36.1509V8.04H34.5909V5.688H39.2469V7.344C39.9669 6.096 41.1269 5.472 42.7269 5.472C43.7509 5.472 44.6389 5.776 45.3909 6.384C46.1429 6.992 46.5189 7.936 46.5189 9.216V14.184H47.9589V16.512Z" fill="currentColor"></path> </svg></a> <p>Your blueprint for a better internet.</p> <ul class="social-icons"> <li><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://mastodon.social/@mdn" target="_blank" rel="me noopener noreferrer"><span class="icon icon-mastodon"></span><span class="visually-hidden">MDN on Mastodon</span></a></li> <li><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://twitter.com/mozdevnet" target="_blank" rel="noopener noreferrer"><span class="icon icon-twitter-x"></span><span class="visually-hidden">MDN on X (formerly Twitter)</span></a></li> <li><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://github.com/mdn/" target="_blank" rel="noopener noreferrer"><span class="icon icon-github-mark-small"></span><span class="visually-hidden">MDN on GitHub</span></a></li> <li><a href="https://developer-mozilla-org.translate.goog/en-US/blog/rss.xml?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" target="_blank"><span class="icon icon-feed"></span><span class="visually-hidden">MDN Blog RSS Feed</span></a></li> </ul> </div> <div class="page-footer-nav-col-1"> <h2 class="footer-nav-heading">MDN</h2> <ul class="footer-nav-list"> <li class="footer-nav-item"><a href="https://developer-mozilla-org.translate.goog/en-US/about?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">About</a></li> <li class="footer-nav-item"><a href="https://developer-mozilla-org.translate.goog/en-US/blog/?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Blog</a></li> <li class="footer-nav-item"><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org/en-US/careers/listings/?team%3DProdOps" target="_blank" rel="noopener noreferrer">Careers</a></li> <li class="footer-nav-item"><a href="https://developer-mozilla-org.translate.goog/en-US/advertising?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Advertise with us</a></li> </ul> </div> <div class="page-footer-nav-col-2"> <h2 class="footer-nav-heading">Support</h2> <ul class="footer-nav-list"> <li class="footer-nav-item"><a class="footer-nav-link" href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://support.mozilla.org/products/mdn-plus">Product help</a></li> <li class="footer-nav-item"><a class="footer-nav-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/MDN/Community/Issues?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Report an issue</a></li> </ul> </div> <div class="page-footer-nav-col-3"> <h2 class="footer-nav-heading">Our communities</h2> <ul class="footer-nav-list"> <li class="footer-nav-item"><a class="footer-nav-link" href="https://developer-mozilla-org.translate.goog/en-US/community?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">MDN Community</a></li> <li class="footer-nav-item"><a class="footer-nav-link" href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://discourse.mozilla.org/c/mdn/236" target="_blank" rel="noopener noreferrer">MDN Forum</a></li> <li class="footer-nav-item"><a class="footer-nav-link" href="https://developer-mozilla-org.translate.goog/discord?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB" target="_blank" rel="noopener noreferrer">MDN Chat</a></li> </ul> </div> <div class="page-footer-nav-col-4"> <h2 class="footer-nav-heading">Developers</h2> <ul class="footer-nav-list"> <li class="footer-nav-item"><a class="footer-nav-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Web?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Web Technologies</a></li> <li class="footer-nav-item"><a class="footer-nav-link" href="https://developer-mozilla-org.translate.goog/en-US/docs/Learn?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">Learn Web Development</a></li> <li class="footer-nav-item"><a class="footer-nav-link" href="https://developer-mozilla-org.translate.goog/en-US/plus?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">MDN Plus</a></li> <li class="footer-nav-item"><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://hacks.mozilla.org/" target="_blank" rel="noopener noreferrer">Hacks Blog</a></li> </ul> </div> <div class="page-footer-moz"> <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org/" class="footer-moz-logo-link" target="_blank" rel="noopener noreferrer"> <svg xmlns="http://www.w3.org/2000/svg" width="137" height="32" fill="none" viewbox="0 0 267.431 62.607"> <path fill="currentColor" d="m13.913 23.056 5.33 25.356h2.195l5.33-25.356h14.267v38.976h-7.578V29.694h-2.194l-7.264 32.337h-7.343L9.418 29.694H7.223v32.337H-.354V23.056Zm47.137 9.123c9.12 0 14.423 5.385 14.423 15.214s-5.33 15.214-14.423 15.214c-9.12 0-14.423-5.385-14.423-15.214 0-9.855 5.304-15.214 14.423-15.214m0 24.363c4.285 0 6.428-2.196 6.428-7.032v-4.287c0-4.836-2.143-7.032-6.428-7.032s-6.428 2.196-6.428 7.032v4.287c0 4.836 2.143 7.032 6.428 7.032m18.473-.157 15.47-18.01h-15.26v-5.647h24.352v5.646L88.616 56.385h15.704v5.646H79.523Zm29.318-23.657h11.183V62.03h-7.578V38.375h-3.632v-5.646zm3.605-9.672h7.578v5.646h-7.578zm13.17 0h11.21v38.976h-7.578v-33.33h-3.632zm16.801 0H153.6v38.976h-7.577v-33.33h-3.632v-5.646zm29.03 9.123c4.442 0 7.394 2.143 8.231 5.881h2.194v-5.332h9.276v5.646h-3.632v18.011h3.632v5.646h-4.442c-3.135 0-4.834-1.699-4.834-4.836V56.7h-2.194c-.81 3.738-3.789 5.881-8.23 5.881-6.978 0-11.916-5.829-11.916-15.214 0-9.384 4.938-15.187 11.915-15.187m2.3 24.363c4.284 0 6.192-2.196 6.192-7.032v-4.287c0-4.836-1.908-7.032-6.193-7.032-4.18 0-6.193 2.196-6.193 7.032v4.287c0 4.836 2.012 7.032 6.193 7.032m48.34 5.489h-7.577V0h7.577zm6.585-29.643h32.165v-2.196l-21.295-7.634v-6.143l21.295-7.633V6.588h-25.345V0h32.165v12.522l-17.35 5.881V20.6l17.35 5.882v12.521h-38.985zm0-25.801h6.794v6.796h-6.794z"></path> </svg></a> <ul class="footer-moz-list"> <li class="footer-moz-item"><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org/privacy/websites/" class="footer-moz-link" target="_blank" rel="noopener noreferrer">Website Privacy Notice</a></li> <li class="footer-moz-item"><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org/privacy/websites/%23cookies" class="footer-moz-link" target="_blank" rel="noopener noreferrer">Cookies</a></li> <li class="footer-moz-item"><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org/about/legal/terms/mozilla" class="footer-moz-link" target="_blank" rel="noopener noreferrer">Legal</a></li> <li class="footer-moz-item"><a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org/about/governance/policies/participation/" class="footer-moz-link" target="_blank" rel="noopener noreferrer">Community Participation Guidelines</a></li> </ul> </div> <div class="page-footer-legal"> <p id="license" class="page-footer-legal-text">Visit<!-- --> <a href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://www.mozilla.org" target="_blank" rel="noopener noreferrer">Mozilla Corporation’s</a> <!-- -->not-for-profit parent, the<!-- --> <a target="_blank" rel="noopener noreferrer" href="https://translate.google.com/website?sl=pl&tl=tr&hl=en-GB&u=https://foundation.mozilla.org/">Mozilla Foundation</a>.<br> Portions of this content are ©1998–<!-- -->2025<!-- --> by individual mozilla.org contributors. Content available under<!-- --> <a href="https://developer-mozilla-org.translate.goog/en-US/docs/MDN/Writing_guidelines/Attrib_copyright_license?_x_tr_sl=pl&_x_tr_tl=tr&_x_tr_hl=en-GB">a Creative Commons license</a>.</p> </div> </div> </footer> </div> <script type="application/json" id="hydration">{"url":"/en-US/docs/Web/JavaScript/Data_structures","doc":{"body":[{"type":"prose","value":{"id":null,"title":null,"isH3":false,"content":"<p>Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures.</p>\n<p>The <a href=\"/en-US/docs/Web/JavaScript/Language_overview\">language overview</a> offers a similar summary of the common data types, but with more comparisons to other languages.</p>"}},{"type":"prose","value":{"id":"dynamic_and_weak_typing","title":"Dynamic and weak typing","isH3":false,"content":"<p>JavaScript is a <a href=\"https://en.wikipedia.org/wiki/Dynamic_programming_language\" class=\"external\" target=\"_blank\">dynamic</a> language with <a href=\"https://en.wikipedia.org/wiki/Type_system#DYNAMIC\" class=\"external\" target=\"_blank\">dynamic types</a>. Variables in JavaScript are not directly associated with any particular value type, and any variable can be assigned (and re-assigned) values of all types:</p>\n<div class=\"code-example\"><div class=\"example-header\"><span class=\"language-name\">js</span></div><pre class=\"brush: js notranslate\"><code>let foo = 42; // foo is now a number\nfoo = \"bar\"; // foo is now a string\nfoo = true; // foo is now a boolean\n</code></pre></div>\n<p>JavaScript is also a <a href=\"https://en.wikipedia.org/wiki/Strong_and_weak_typing\" class=\"external\" target=\"_blank\">weakly typed</a> language, which means it allows implicit type conversion when an operation involves mismatched types, instead of throwing type errors.</p>\n<div class=\"code-example\"><div class=\"example-header\"><span class=\"language-name\">js</span></div><pre class=\"brush: js notranslate\"><code>const foo = 42; // foo is a number\nconst result = foo + \"1\"; // JavaScript coerces foo to a string, so it can be concatenated with the other operand\nconsole.log(result); // 421\n</code></pre></div>\n<p>Implicit coercions are very convenient, but can create subtle bugs when conversions happen where they are not expected, or where they are expected to happen in the other direction (for example, string to number instead of number to string). For <a href=\"#symbol_type\">symbols</a> and <a href=\"#bigint_type\">BigInts</a>, JavaScript has intentionally disallowed certain implicit type conversions.</p>"}},{"type":"prose","value":{"id":"primitive_values","title":"Primitive values","isH3":false,"content":"<p>All types except <a href=\"#objects\">Object</a> define <a href=\"/en-US/docs/Glossary/Immutable\">immutable</a> values represented directly at the lowest level of the language. We refer to values of these types as <em>primitive values</em>.</p>\n<p>All primitive types, except <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/null\"><code>null</code></a>, can be tested by the <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/typeof\"><code>typeof</code></a> operator. <code>typeof null</code> returns <code>\"object\"</code>, so one has to use <code>=== null</code> to test for <code>null</code>.</p>\n<p>All primitive types, except <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/null\"><code>null</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined\"><code>undefined</code></a>, have their corresponding object wrapper types, which provide useful methods for working with the primitive values. For example, the <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><code>Number</code></a> object provides methods like <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toExponential\"><code>toExponential()</code></a>. When a property is accessed on a primitive value, JavaScript automatically wraps the value into the corresponding wrapper object and accesses the property on the object instead. However, accessing a property on <code>null</code> or <code>undefined</code> throws a <code>TypeError</code> exception, which necessitates the introduction of the <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining\">optional chaining</a> operator.</p>\n<figure class=\"table-container\"><table>\n<thead>\n<tr>\n<th>Type</th>\n<th><code>typeof</code> return value</th>\n<th>Object wrapper</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"#null_type\">Null</a></td>\n<td><code>\"object\"</code></td>\n<td>N/A</td>\n</tr>\n<tr>\n<td><a href=\"#undefined_type\">Undefined</a></td>\n<td><code>\"undefined\"</code></td>\n<td>N/A</td>\n</tr>\n<tr>\n<td><a href=\"#boolean_type\">Boolean</a></td>\n<td><code>\"boolean\"</code></td>\n<td><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><code>Boolean</code></a></td>\n</tr>\n<tr>\n<td><a href=\"#number_type\">Number</a></td>\n<td><code>\"number\"</code></td>\n<td><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><code>Number</code></a></td>\n</tr>\n<tr>\n<td><a href=\"#bigint_type\">BigInt</a></td>\n<td><code>\"bigint\"</code></td>\n<td><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt\"><code>BigInt</code></a></td>\n</tr>\n<tr>\n<td><a href=\"#string_type\">String</a></td>\n<td><code>\"string\"</code></td>\n<td><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><code>String</code></a></td>\n</tr>\n<tr>\n<td><a href=\"#symbol_type\">Symbol</a></td>\n<td><code>\"symbol\"</code></td>\n<td><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\"><code>Symbol</code></a></td>\n</tr>\n</tbody>\n</table></figure>\n<p>The object wrapper classes' reference pages contain more information about the methods and properties available for each type, as well as detailed descriptions for the semantics of the primitive types themselves.</p>"}},{"type":"prose","value":{"id":"null_type","title":"Null type","isH3":true,"content":"<p>The Null type is inhabited by exactly one value: <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/null\"><code>null</code></a>.</p>"}},{"type":"prose","value":{"id":"undefined_type","title":"Undefined type","isH3":true,"content":"<p>The Undefined type is inhabited by exactly one value: <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined\"><code>undefined</code></a>.</p>\n<p>Conceptually, <code>undefined</code> indicates the absence of a <em>value</em>, while <code>null</code> indicates the absence of an <em>object</em> (which could also make up an excuse for <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/typeof#typeof_null\"><code>typeof null === \"object\"</code></a>). The language usually defaults to <code>undefined</code> when something is devoid of a value:</p>\n<ul>\n<li>A <a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/return\"><code>return</code></a> statement with no value (<code>return;</code>) implicitly returns <code>undefined</code>.</li>\n<li>Accessing a nonexistent <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\">object</a> property (<code>obj.iDontExist</code>) returns <code>undefined</code>.</li>\n<li>A variable declaration without initialization (<code>let x;</code>) implicitly initializes the variable to <code>undefined</code>.</li>\n<li>Many methods, such as <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\"><code>Array.prototype.find()</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get\"><code>Map.prototype.get()</code></a>, return <code>undefined</code> when no element is found.</li>\n</ul>\n<p><code>null</code> is used much less often in the core language. The most important place is the end of the <a href=\"/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain\">prototype chain</a> — subsequently, methods that interact with prototypes, such as <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf\"><code>Object.getPrototypeOf()</code></a>, <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create\"><code>Object.create()</code></a>, etc., accept or return <code>null</code> instead of <code>undefined</code>.</p>\n<p><code>null</code> is a <a href=\"/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#keywords\">keyword</a>, but <code>undefined</code> is a normal <a href=\"/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#identifiers\">identifier</a> that happens to be a global property. In practice, the difference is minor, since <code>undefined</code> should not be redefined or shadowed.</p>"}},{"type":"prose","value":{"id":"boolean_type","title":"Boolean type","isH3":true,"content":"<p>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\"><code>Boolean</code></a> type represents a logical entity and is inhabited by two values: <code>true</code> and <code>false</code>.</p>\n<p>Boolean values are usually used for conditional operations, including <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator\">ternary operators</a>, <a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/if...else\"><code>if...else</code></a>, <a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/while\"><code>while</code></a>, etc.</p>"}},{"type":"prose","value":{"id":"number_type","title":"Number type","isH3":true,"content":"<p>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\"><code>Number</code></a> type is a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_encoding\">double-precision 64-bit binary format IEEE 754 value</a>. It is capable of storing positive floating-point numbers between 2<sup>-1074</sup> (<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE\"><code>Number.MIN_VALUE</code></a>) and 2<sup>1023</sup> × (2 - 2<sup>-52</sup>) (<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE\"><code>Number.MAX_VALUE</code></a>) as well as negative floating-point numbers of the same magnitude, but it can only safely store integers in the range -(2<sup>53</sup> − 1) (<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER\"><code>Number.MIN_SAFE_INTEGER</code></a>) to 2<sup>53</sup> − 1 (<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>). Outside this range, JavaScript can no longer safely represent integers; they will instead be represented by a double-precision floating point approximation. You can check if a number is within the range of safe integers using <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger\"><code>Number.isSafeInteger()</code></a>.</p>\n<p>Values outside the representable range are automatically converted:</p>\n<ul>\n<li>Positive values greater than <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE\"><code>Number.MAX_VALUE</code></a> are converted to <code>+Infinity</code>.</li>\n<li>Positive values smaller than <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE\"><code>Number.MIN_VALUE</code></a> are converted to <code>+0</code>.</li>\n<li>Negative values smaller than -<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE\"><code>Number.MAX_VALUE</code></a> are converted to <code>-Infinity</code>.</li>\n<li>Negative values greater than -<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_VALUE\"><code>Number.MIN_VALUE</code></a> are converted to <code>-0</code>.</li>\n</ul>\n<p><code>+Infinity</code> and <code>-Infinity</code> behave similarly to mathematical infinity, but with some slight differences; see <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/POSITIVE_INFINITY\"><code>Number.POSITIVE_INFINITY</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/NEGATIVE_INFINITY\"><code>Number.NEGATIVE_INFINITY</code></a> for details.</p>\n<p>The Number type has only one value with multiple representations: <code>0</code> is represented as both <code>-0</code> and <code>+0</code> (where <code>0</code> is an alias for <code>+0</code>). In practice, there is almost no difference between the different representations; for example, <code>+0 === -0</code> is <code>true</code>. However, you are able to notice this when you divide by zero:</p>\n<div class=\"code-example\"><div class=\"example-header\"><span class=\"language-name\">js</span></div><pre class=\"brush: js notranslate\"><code>console.log(42 / +0); // Infinity\nconsole.log(42 / -0); // -Infinity\n</code></pre></div>\n<p><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN\"><code>NaN</code></a> (\"<strong>N</strong>ot <strong>a</strong> <strong>N</strong>umber\") is a special kind of number value that's typically encountered when the result of an arithmetic operation cannot be expressed as a number. It is also the only value in JavaScript that is not equal to itself.</p>\n<p>Although a number is conceptually a \"mathematical value\" and is always implicitly floating-point-encoded, JavaScript provides <a href=\"/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators#bitwise_operators\">bitwise operators</a>. When applying bitwise operators, the number is first converted to a 32-bit integer.</p>\n<div class=\"notecard note\">\n<p><strong>Note:</strong>\nAlthough bitwise operators <em>can</em> be used to represent several Boolean values within a single number using <a href=\"https://en.wikipedia.org/wiki/Mask_%28computing%29\" class=\"external\" target=\"_blank\">bit masking</a>, this is usually considered a bad practice. JavaScript offers other means to represent a set of Booleans (like an array of Booleans, or an object with Boolean values assigned to named properties). Bit masking also tends to make the code more difficult to read, understand, and maintain.</p>\n</div>\n<p>It may be necessary to use such techniques in very constrained environments, like when trying to cope with the limitations of local storage, or in extreme cases (such as when each bit over the network counts). This technique should only be considered when it is the last measure that can be taken to optimize size.</p>"}},{"type":"prose","value":{"id":"bigint_type","title":"BigInt type","isH3":true,"content":"<p>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt\"><code>BigInt</code></a> type is a numeric primitive in JavaScript that can represent integers with arbitrary magnitude. With BigInts, you can safely store and operate on large integers even beyond the safe integer limit (<a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>) for Numbers.</p>\n<p>A BigInt is created by appending <code>n</code> to the end of an integer or by calling the <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/BigInt\"><code>BigInt()</code></a> function.</p>\n<p>This example demonstrates where incrementing the <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a> returns the expected result:</p>\n<div class=\"code-example\"><div class=\"example-header\"><span class=\"language-name\">js</span></div><pre class=\"brush: js notranslate\"><code>// BigInt\nconst x = BigInt(Number.MAX_SAFE_INTEGER); // 9007199254740991n\nx + 1n === x + 2n; // false because 9007199254740992n and 9007199254740993n are unequal\n\n// Number\nNumber.MAX_SAFE_INTEGER + 1 === Number.MAX_SAFE_INTEGER + 2; // true because both are 9007199254740992\n</code></pre></div>\n<p>You can use most operators to work with BigInts, including <code>+</code>, <code>*</code>, <code>-</code>, <code>**</code>, and <code>%</code> — the only forbidden one is <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift\"><code>>>></code></a>. A BigInt is not <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality\">strictly equal</a> to a Number with the same mathematical value, but it is <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Equality\">loosely</a> so.</p>\n<p>BigInt values are neither always more precise nor always less precise than numbers, since BigInts cannot represent fractional numbers, but can represent big integers more accurately. Neither type entails the other, and they are not mutually substitutable. A <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\"><code>TypeError</code></a> is thrown if BigInt values are mixed with regular numbers in arithmetic expressions, or if they are <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\">implicitly converted</a> to each other.</p>"}},{"type":"prose","value":{"id":"string_type","title":"String type","isH3":true,"content":"<p>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\"><code>String</code></a> type represents textual data and is encoded as a sequence of 16-bit unsigned integer values representing <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_code_points_and_grapheme_clusters\">UTF-16 code units</a>. Each element in the string occupies a position in the string. The first element is at index <code>0</code>, the next at index <code>1</code>, and so on. The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length\">length</a> of a string is the number of UTF-16 code units in it, which may not correspond to the actual number of Unicode characters; see the <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#utf-16_characters_unicode_code_points_and_grapheme_clusters\"><code>String</code></a> reference page for more details.</p>\n<p>JavaScript strings are immutable. This means that once a string is created, it is not possible to modify it. String methods create new strings based on the content of the current string — for example:</p>\n<ul>\n<li>A substring of the original using <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring\"><code>substring()</code></a>.</li>\n<li>A concatenation of two strings using the concatenation operator (<code>+</code>) or <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat\"><code>concat()</code></a>.</li>\n</ul>\n<h4 id=\"beware_of_stringly-typing_your_code!\">Beware of \"stringly-typing\" your code!</h4>\n<p>It can be tempting to use strings to represent complex data. Doing this comes with short-term benefits:</p>\n<ul>\n<li>It is easy to build complex strings with concatenation.</li>\n<li>Strings are easy to debug (what you see printed is always what is in the string).</li>\n<li>Strings are the common denominator of a lot of APIs (<a href=\"/en-US/docs/Web/API/HTMLInputElement\">input fields</a>, <a href=\"/en-US/docs/Web/API/Web_Storage_API\">local storage</a> values, <a href=\"/en-US/docs/Web/API/Window/fetch\"><code>fetch()</code></a> responses when using <a href=\"/en-US/docs/Web/API/Response/text\"><code>Response.text()</code></a>, etc.) and it can be tempting to only work with strings.</li>\n</ul>\n<p>With conventions, it is possible to represent any data structure in a string. This does not make it a good idea. For instance, with a separator, one could emulate a list (while a JavaScript array would be more suitable). Unfortunately, when the separator is used in one of the \"list\" elements, then, the list is broken. An escape character can be chosen, etc. All of this requires conventions and creates an unnecessary maintenance burden.</p>\n<p>Use strings for textual data. When representing complex data, <em>parse</em> strings, and use the appropriate abstraction.</p>"}},{"type":"prose","value":{"id":"symbol_type","title":"Symbol type","isH3":true,"content":"<p>A <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\"><code>Symbol</code></a> is a <strong>unique</strong> and <strong>immutable</strong> primitive value and may be used as the key of an Object property (see below). In some programming languages, Symbols are called \"atoms\". The purpose of symbols is to create unique property keys that are guaranteed not to clash with keys from other code.</p>"}},{"type":"prose","value":{"id":"objects","title":"Objects","isH3":false,"content":"<p>In computer science, an object is a value in memory which is possibly referenced by an <a href=\"/en-US/docs/Glossary/Identifier\">identifier</a>. In JavaScript, objects are the only <a href=\"/en-US/docs/Glossary/Mutable\">mutable</a> values. <a href=\"/en-US/docs/Web/JavaScript/Reference/Functions\">Functions</a> are, in fact, also objects with the additional capability of being <em>callable</em>.</p>"}},{"type":"prose","value":{"id":"properties","title":"Properties","isH3":true,"content":"<p>In JavaScript, objects can be seen as a collection of properties. With the <a href=\"/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#object_literals\">object literal syntax</a>, a limited set of properties are initialized; then properties can be added and removed. Object properties are equivalent to key-value pairs. Property keys are either <a href=\"#string_type\">strings</a> or <a href=\"#symbol_type\">symbols</a>. When other types (such as numbers) are used to index objects, the values are implicitly converted to strings. Property values can be values of any type, including other objects, which enables building complex data structures.</p>\n<p>There are two types of object properties: The <a href=\"#data_property\"><em>data</em> property</a> and the <a href=\"#accessor_property\"><em>accessor</em> property</a>. Each property has corresponding <em>attributes</em>. Each attribute is accessed internally by the JavaScript engine, but you can set them through <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\"><code>Object.defineProperty()</code></a>, or read them through <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor\"><code>Object.getOwnPropertyDescriptor()</code></a>. You can read more about the various nuances on the <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\"><code>Object.defineProperty()</code></a> page.</p>\n<h4 id=\"data_property\">Data property</h4>\n<p>Data properties associate a key with a value. It can be described by the following attributes:</p>\n<dl>\n<dt id=\"value\"><a href=\"#value\"><code>value</code></a></dt>\n<dd>\n<p>The value retrieved by a get access of the property. Can be any JavaScript value.</p>\n</dd>\n<dt id=\"writable\"><a href=\"#writable\"><code>writable</code></a></dt>\n<dd>\n<p>A boolean value indicating if the property can be changed with an assignment.</p>\n</dd>\n<dt id=\"enumerable\"><a href=\"#enumerable\"><code>enumerable</code></a></dt>\n<dd>\n<p>A boolean value indicating if the property can be enumerated by a <a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/for...in\"><code>for...in</code></a> loop. See also <a href=\"/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties\">Enumerability and ownership of properties</a> for how enumerability interacts with other functions and syntaxes.</p>\n</dd>\n<dt id=\"configurable\"><a href=\"#configurable\"><code>configurable</code></a></dt>\n<dd>\n<p>A boolean value indicating if the property can be deleted, can be changed to an accessor property, and can have its attributes changed.</p>\n</dd>\n</dl>\n<h4 id=\"accessor_property\">Accessor property</h4>\n<p>Associates a key with one of two accessor functions (<code>get</code> and <code>set</code>) to retrieve or store a value.</p>\n<div class=\"notecard note\">\n<p><strong>Note:</strong>\nIt's important to recognize it's accessor <em>property</em> — not accessor <em>method</em>. We can give a JavaScript object class-like accessors by using a function as a value — but that doesn't make the object a class.</p>\n</div>\n<p>An accessor property has the following attributes:</p>\n<dl>\n<dt id=\"get\"><a href=\"#get\"><code>get</code></a></dt>\n<dd>\n<p>A function called with an empty argument list to retrieve the property value whenever a get access to the value is performed. See also <a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/get\">getters</a>. May be <code>undefined</code>.</p>\n</dd>\n<dt id=\"set\"><a href=\"#set\"><code>set</code></a></dt>\n<dd>\n<p>A function called with an argument that contains the assigned value. Executed whenever a specified property is attempted to be changed. See also <a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/set\">setters</a>. May be <code>undefined</code>.</p>\n</dd>\n<dt id=\"enumerable_2\"><a href=\"#enumerable_2\"><code>enumerable</code></a></dt>\n<dd>\n<p>A boolean value indicating if the property can be enumerated by a <a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/for...in\"><code>for...in</code></a> loop. See also <a href=\"/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties\">Enumerability and ownership of properties</a> for how enumerability interacts with other functions and syntaxes.</p>\n</dd>\n<dt id=\"configurable_2\"><a href=\"#configurable_2\"><code>configurable</code></a></dt>\n<dd>\n<p>A boolean value indicating if the property can be deleted, can be changed to a data property, and can have its attributes changed.</p>\n</dd>\n</dl>\n<p>The <a href=\"/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain\">prototype</a> of an object points to another object or to <code>null</code> — it's conceptually a hidden property of the object, commonly represented as <code>[[Prototype]]</code>. Properties of the object's <code>[[Prototype]]</code> can also be accessed on the object itself.</p>\n<p>Objects are ad-hoc key-value pairs, so they are often used as maps. However, there can be ergonomics, security, and performance issues. Use a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>Map</code></a> for storing arbitrary data instead. The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#objects_vs._maps\"><code>Map</code> reference</a> contains a more detailed discussion of the pros & cons between plain objects and maps for storing key-value associations.</p>"}},{"type":"prose","value":{"id":"dates","title":"Dates","isH3":true,"content":"<p>JavaScript provides two sets of APIs for representing dates: the legacy <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\"><code>Date</code></a> object and the modern <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal\"><code>Temporal</code></a> object. <code>Date</code> has many undesirable design choices and should be avoided in new code if possible.</p>"}},{"type":"prose","value":{"id":"indexed_collections_arrays_and_typed_arrays","title":"Indexed collections: Arrays and typed Arrays","isH3":true,"content":"<p><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\">Arrays</a> are regular objects for which there is a particular relationship between integer-keyed properties and the <code>length</code> property.</p>\n<p>Additionally, arrays inherit from <code>Array.prototype</code>, which provides a handful of convenient methods to manipulate arrays. For example, <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf\"><code>indexOf()</code></a> searches a value in the array and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/push\"><code>push()</code></a> appends an element to the array. This makes Arrays a perfect candidate to represent ordered lists.</p>\n<p><a href=\"/en-US/docs/Web/JavaScript/Guide/Typed_arrays\">Typed Arrays</a> present an array-like view of an underlying binary data buffer, and offer many methods that have similar semantics to the array counterparts. \"Typed array\" is an umbrella term for a range of data structures, including <code>Int8Array</code>, <code>Float32Array</code>, etc. Check the <a href=\"/en-US/docs/Web/JavaScript/Guide/Typed_arrays\">typed array</a> page for more information. Typed arrays are often used in conjunction with <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>ArrayBuffer</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>DataView</code></a>.</p>"}},{"type":"prose","value":{"id":"keyed_collections_maps_sets_weakmaps_weaksets","title":"Keyed collections: Maps, Sets, WeakMaps, WeakSets","isH3":true,"content":"<p>These data structures take object references as keys. <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>Set</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>WeakSet</code></a> represent a collection of unique values, while <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>Map</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>WeakMap</code></a> represent a collection of key-value associations.</p>\n<p>You could implement <code>Map</code>s and <code>Set</code>s yourself. However, since objects cannot be compared (in the sense of <code><</code> \"less than\", for instance), neither does the engine expose its hash function for objects, look-up performance would necessarily be linear. Native implementations of them (including <code>WeakMap</code>s) can have look-up performance that is approximately logarithmic to constant time.</p>\n<p>Usually, to bind data to a DOM node, one could set properties directly on the object, or use <code>data-*</code> attributes. This has the downside that the data is available to any script running in the same context. <code>Map</code>s and <code>WeakMap</code>s make it easy to <em>privately</em> bind data to an object.</p>\n<p><code>WeakMap</code> and <code>WeakSet</code> only allow garbage-collectable values as keys, which are either objects or <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol#shared_symbols_in_the_global_symbol_registry\">non-registered symbols</a>, and the keys may be collected even when they remain in the collection. They are specifically used for <a href=\"/en-US/docs/Web/JavaScript/Memory_management#data_structures_aiding_memory_management\">memory usage optimization</a>.</p>"}},{"type":"prose","value":{"id":"structured_data_json","title":"Structured data: JSON","isH3":true,"content":"<p>JSON (<strong>J</strong>ava<strong>S</strong>cript <strong>O</strong>bject <strong>N</strong>otation) is a lightweight data-interchange format, derived from JavaScript, but used by many programming languages. JSON builds universal data structures that can be transferred between different environments and even across languages. See <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON\"><code>JSON</code></a> for more details.</p>"}},{"type":"prose","value":{"id":"more_objects_in_the_standard_library","title":"More objects in the standard library","isH3":true,"content":"<p>JavaScript has a standard library of built-in objects. Read the <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects\">reference</a> to find out more about the built-in objects.</p>"}},{"type":"prose","value":{"id":"type_coercion","title":"Type coercion","isH3":false,"content":"<p>As mentioned above, JavaScript is a <a href=\"#dynamic_and_weak_typing\">weakly typed</a> language. This means that you can often use a value of one type where another type is expected, and the language will convert it to the right type for you. To do so, JavaScript defines a handful of coercion rules.</p>"}},{"type":"prose","value":{"id":"primitive_coercion","title":"Primitive coercion","isH3":true,"content":"<p>The <a href=\"https://tc39.es/ecma262/multipage/abstract-operations.html#sec-toprimitive\" class=\"external\" target=\"_blank\">primitive coercion</a> process is used where a primitive value is expected, but there's no strong preference for what the actual type should be. This is usually when a <a href=\"#string_type\">string</a>, a <a href=\"#number_type\">number</a>, or a <a href=\"#bigint_type\">BigInt</a> are equally acceptable. For example:</p>\n<ul>\n<li>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date\"><code>Date()</code></a> constructor, when it receives one argument that's not a <code>Date</code> instance — strings represent date strings, while numbers represent timestamps.</li>\n<li>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Addition\"><code>+</code></a> operator — if one operand is a string, string concatenation is performed; otherwise, numeric addition is performed.</li>\n<li>The <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Equality\"><code>==</code></a> operator — if one operand is a primitive while the other is an object, the object is converted to a primitive value with no preferred type.</li>\n</ul>\n<p>This operation does not do any conversion if the value is already a primitive. Objects are converted to primitives by calling its <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toPrimitive\"><code>[Symbol.toPrimitive]()</code></a> (with <code>\"default\"</code> as hint), <code>valueOf()</code>, and <code>toString()</code> methods, in that order. Note that primitive conversion calls <code>valueOf()</code> before <code>toString()</code>, which is similar to the behavior of <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\">number coercion</a> but different from <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion\">string coercion</a>.</p>\n<p>The <code>[Symbol.toPrimitive]()</code> method, if present, must return a primitive — returning an object results in a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\"><code>TypeError</code></a>. For <code>valueOf()</code> and <code>toString()</code>, if one returns an object, the return value is ignored and the other's return value is used instead; if neither is present, or neither returns a primitive, a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\"><code>TypeError</code></a> is thrown. For example, in the following code:</p>\n<div class=\"code-example\"><div class=\"example-header\"><span class=\"language-name\">js</span></div><pre class=\"brush: js notranslate\"><code>console.log({} + []); // \"[object Object]\"\n</code></pre></div>\n<p>Neither <code>{}</code> nor <code>[]</code> have a <code>[Symbol.toPrimitive]()</code> method. Both <code>{}</code> and <code>[]</code> inherit <code>valueOf()</code> from <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf\"><code>Object.prototype.valueOf</code></a>, which returns the object itself. Since the return value is an object, it is ignored. Therefore, <code>toString()</code> is called instead. <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString\"><code>{}.toString()</code></a> returns <code>\"[object Object]\"</code>, while <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString\"><code>[].toString()</code></a> returns <code>\"\"</code>, so the result is their concatenation: <code>\"[object Object]\"</code>.</p>\n<p>The <code>[Symbol.toPrimitive]()</code> method always takes precedence when doing conversion to any primitive type. Primitive conversion generally behaves like number conversion, because <code>valueOf()</code> is called in priority; however, objects with custom <code>[Symbol.toPrimitive]()</code> methods can choose to return any primitive. <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\"><code>Date</code></a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\"><code>Symbol</code></a> objects are the only built-in objects that override the <code>[Symbol.toPrimitive]()</code> method. <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Symbol.toPrimitive\"><code>Date.prototype[Symbol.toPrimitive]()</code></a> treats the <code>\"default\"</code> hint as if it's <code>\"string\"</code>, while <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol.toPrimitive\"><code>Symbol.prototype[Symbol.toPrimitive]()</code></a> ignores the hint and always returns a symbol.</p>"}},{"type":"prose","value":{"id":"numeric_coercion","title":"Numeric coercion","isH3":true,"content":"<p>There are two numeric types: <a href=\"#number_type\">Number</a> and <a href=\"#bigint_type\">BigInt</a>. Sometimes the language specifically expects a number or a BigInt (such as <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice\"><code>Array.prototype.slice()</code></a>, where the index must be a number); other times, it may tolerate either and perform different operations depending on the operand's type. For strict coercion processes that do not allow implicit conversion from the other type, see <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\">number coercion</a> and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#bigint_coercion\">BigInt coercion</a>.</p>\n<p>Numeric coercion is nearly the same as <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\">number coercion</a>, except that BigInts are returned as-is instead of causing a <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\"><code>TypeError</code></a>. Numeric coercion is used by all arithmetic operators, since they are overloaded for both numbers and BigInts. The only exception is <a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Unary_plus\">unary plus</a>, which always does number coercion.</p>"}},{"type":"prose","value":{"id":"other_coercions","title":"Other coercions","isH3":true,"content":"<p>All data types, except Null, Undefined, and Symbol, have their respective coercion process. See <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion\">string coercion</a>, <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean#boolean_coercion\">boolean coercion</a>, and <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object#object_coercion\">object coercion</a> for more details.</p>\n<p>As you may have noticed, there are three distinct paths through which objects may be converted to primitives:</p>\n<ul>\n<li><a href=\"#primitive_coercion\">Primitive coercion</a>: <code>[Symbol.toPrimitive](\"default\")</code> → <code>valueOf()</code> → <code>toString()</code></li>\n<li><a href=\"#numeric_coercion\">Numeric coercion</a>, <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#number_coercion\">number coercion</a>, <a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#bigint_coercion\">BigInt coercion</a>: <code>[Symbol.toPrimitive](\"number\")</code> → <code>valueOf()</code> → <code>toString()</code></li>\n<li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion\">String coercion</a>: <code>[Symbol.toPrimitive](\"string\")</code> → <code>toString()</code> → <code>valueOf()</code></li>\n</ul>\n<p>In all cases, <code>[Symbol.toPrimitive]()</code>, if present, must be callable and return a primitive, while <code>valueOf</code> or <code>toString</code> will be ignored if they are not callable or return an object. At the end of the process, if successful, the result is guaranteed to be a primitive. The resulting primitive is then subject to further coercions depending on the context.</p>"}},{"type":"prose","value":{"id":"see_also","title":"See also","isH3":false,"content":"<ul>\n<li><a href=\"https://github.com/trekhleb/javascript-algorithms\" class=\"external\" target=\"_blank\">JavaScript Data Structures and Algorithms</a> by Oleksii Trekhleb</li>\n<li><a href=\"https://github.com/humanwhocodes/computer-science-in-javascript\" class=\"external\" target=\"_blank\">Computer Science in JavaScript</a> by Nicholas C. Zakas</li>\n</ul>"}}],"isActive":true,"isMarkdown":true,"isTranslated":false,"locale":"en-US","mdn_url":"/en-US/docs/Web/JavaScript/Data_structures","modified":"2025-01-20T22:28:20.000Z","native":"English (US)","noIndexing":false,"other_translations":[{"locale":"de","title":"JavaScript Datentypen und Datenstrukturen","native":"Deutsch"},{"locale":"es","title":"Tipos de datos y estructuras en JavaScript","native":"Español"},{"locale":"fr","title":"Types et structures de données JavaScript","native":"Français"},{"locale":"ja","title":"JavaScript のデータ型とデータ構造","native":"日本語"},{"locale":"ko","title":"JavaScript의 타입과 자료구조","native":"한국어"},{"locale":"pt-BR","title":"Estrutura de dados do Javascript","native":"Português (do Brasil)"},{"locale":"ru","title":"Типы и структуры данных JavaScript","native":"Русский"},{"locale":"zh-CN","title":"JavaScript 数据类型和数据结构","native":"中文 (简体)"},{"locale":"zh-TW","title":"JavaScript 的資料型別與資料結構","native":"正體中文 (繁體)"}],"pageTitle":"JavaScript data types and data structures - JavaScript | MDN","parents":[{"uri":"/en-US/docs/Web","title":"References"},{"uri":"/en-US/docs/Web/JavaScript","title":"JavaScript"},{"uri":"/en-US/docs/Web/JavaScript/Data_structures","title":"JavaScript data types and data structures"}],"popularity":null,"short_title":"JavaScript data types and data structures","sidebarHTML":"<ol><li class=\"section\"><a href=\"/en-US/docs/Web/JavaScript\">JavaScript</a></li><li class=\"section\">Tutorials and guides</li><li class=\"toggle\"><details><summary>Beginner's tutorials</summary><ol><li><a href=\"/en-US/docs/Learn_web_development/Getting_started/Your_first_website/Adding_interactivity\">Your first website: Adding interactivity</a></li><li><a href=\"/en-US/docs/Learn_web_development/Core/Scripting\">Dynamic scripting with JavaScript</a></li><li><a href=\"/en-US/docs/Learn_web_development/Core/Frameworks_libraries\">JavaScript frameworks and libraries</a></li></ol></details></li><li class=\"toggle\"><details><summary>JavaScript Guide</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Introduction\">Introduction</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Grammar_and_types\">Grammar and types</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling\">Control flow and error handling</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration\">Loops and iteration</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Functions\">Functions</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Expressions_and_operators\">Expressions and operators</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Numbers_and_strings\">Numbers and strings</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Representing_dates_times\">Representing dates & times</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Regular_expressions\">Regular expressions</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Indexed_collections\">Indexed collections</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Keyed_collections\">Keyed collections</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Working_with_objects\">Working with objects</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Using_classes\">Using classes</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Using_promises\">Using promises</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Typed_arrays\">JavaScript typed arrays</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Iterators_and_generators\">Iterators and generators</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Internationalization\">Internationalization</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Meta_programming\">Meta programming</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Guide/Modules\">JavaScript modules</a></li></ol></details></li><li class=\"toggle\"><details open=\"\"><summary>Intermediate</summary><ol><li><a href=\"/en-US/docs/Learn_web_development/Extensions/Advanced_JavaScript_objects\">Advanced JavaScript objects</a></li><li><a href=\"/en-US/docs/Learn_web_development/Extensions/Async_JS\">Asynchronous JavaScript</a></li><li><a href=\"/en-US/docs/Learn_web_development/Extensions/Client-side_APIs\">Client-side web APIs</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Language_overview\">Language overview</a></li><li><em><a href=\"/en-US/docs/Web/JavaScript/Data_structures\" aria-current=\"page\">JavaScript data structures</a></em></li><li><a href=\"/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness\">Equality comparisons and sameness</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties\">Enumerability and ownership of properties</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Closures\">Closures</a></li></ol></details></li><li class=\"toggle\"><details><summary>Advanced</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain\">Inheritance and the prototype chain</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Memory_management\">Memory Management</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Event_loop\">Concurrency model and Event Loop</a></li></ol></details></li><li class=\"section\"><a href=\"/en-US/docs/Web/JavaScript/Reference\">References</a></li><li class=\"toggle\"><details><summary>Built-in objects</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\">AggregateError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array\">Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\">ArrayBuffer</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction\">AsyncFunction</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGenerator\">AsyncGenerator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncGeneratorFunction\">AsyncGeneratorFunction</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator\">AsyncIterator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics\">Atomics</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt\">BigInt</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array\">BigInt64Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array\">BigUint64Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">Boolean</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView\">DataView</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\">Date</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURI\">decodeURI()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent\">decodeURIComponent()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI\">encodeURI()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\">encodeURIComponent()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error\">Error</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/escape\">escape()</a><abbr class=\"icon icon-deprecated\" title=\"Deprecated. Not for use in new websites.\">\n<span class=\"visually-hidden\">Deprecated</span>\n</abbr></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval\">eval()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError\">EvalError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry\">FinalizationRegistry</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float16Array\">Float16Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array\">Float32Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array\">Float64Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\">Function</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator\">Generator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction\">GeneratorFunction</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\">globalThis</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity\">Infinity</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array\">Int16Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array\">Int32Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array\">Int8Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError\">InternalError</a><abbr class=\"icon icon-nonstandard\" title=\"Non-standard. Check cross-browser support before using.\">\n<span class=\"visually-hidden\">Non-standard</span>\n</abbr></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl\">Intl</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite\">isFinite()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN\">isNaN()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator\">Iterator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON\">JSON</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\">Map</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math\">Math</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN\">NaN</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number\">Number</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\">Object</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat\">parseFloat()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\">parseInt()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\">Promise</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy\">Proxy</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError\">RangeError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError\">ReferenceError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect\">Reflect</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp\">RegExp</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set\">Set</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\">SharedArrayBuffer</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">String</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol\">Symbol</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError\">SyntaxError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal\">Temporal</a><abbr class=\"icon icon-experimental\" title=\"Experimental. Expect behavior to change in the future.\">\n<span class=\"visually-hidden\">Experimental</span>\n</abbr></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\">TypedArray</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError\">TypeError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array\">Uint16Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array\">Uint32Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\">Uint8Array</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray\">Uint8ClampedArray</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined\">undefined</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape\">unescape()</a><abbr class=\"icon icon-deprecated\" title=\"Deprecated. Not for use in new websites.\">\n<span class=\"visually-hidden\">Deprecated</span>\n</abbr></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError\">URIError</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\">WeakMap</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakRef\">WeakRef</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\">WeakSet</a></li></ol></details></li><li class=\"toggle\"><details><summary>Expressions & operators</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Addition\">Addition (+)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Addition_assignment\">Addition assignment (+=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Assignment\">Assignment (=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/async_function\">async function expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/async_function*\">async function* expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/await\">await</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND\">Bitwise AND (&)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND_assignment\">Bitwise AND assignment (&=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_NOT\">Bitwise NOT (~)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR\">Bitwise OR (|)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR_assignment\">Bitwise OR assignment (|=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_XOR\">Bitwise XOR (^)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_XOR_assignment\">Bitwise XOR assignment (^=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/class\">class expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Comma_operator\">Comma operator (,)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_operator\">Conditional (ternary) operator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Decrement\">Decrement (--)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/delete\">delete</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment\">Destructuring assignment</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Division\">Division (/)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Division_assignment\">Division assignment (/=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Equality\">Equality (==)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation\">Exponentiation (**)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation_assignment\">Exponentiation assignment (**=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/function\">function expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/function*\">function* expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than\">Greater than (>)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Greater_than_or_equal\">Greater than or equal (>=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Grouping\">Grouping operator ( )</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/import.meta\">import.meta</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/import\">import()</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/in\">in</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Increment\">Increment (++)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Inequality\">Inequality (!=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/instanceof\">instanceof</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Left_shift\">Left shift (<<)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Left_shift_assignment\">Left shift assignment (<<=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Less_than\">Less than (<)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Less_than_or_equal\">Less than or equal (<=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND\">Logical AND (&&)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Logical_AND_assignment\">Logical AND assignment (&&=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Logical_NOT\">Logical NOT (!)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR\">Logical OR (||)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment\">Logical OR assignment (||=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Multiplication\">Multiplication (*)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Multiplication_assignment\">Multiplication assignment (*=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/new\">new</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/new.target\">new.target</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/null\">null</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment\">Nullish coalescing assignment (??=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing\">Nullish coalescing operator (??)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer\">Object initializer</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence\">Operator precedence</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining\">Optional chaining (?.)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors\">Property accessors</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Remainder\">Remainder (%)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Remainder_assignment\">Remainder assignment (%=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Right_shift\">Right shift (>>)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Right_shift_assignment\">Right shift assignment (>>=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax\">Spread syntax (...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality\">Strict equality (===)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Strict_inequality\">Strict inequality (!==)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Subtraction\">Subtraction (-)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Subtraction_assignment\">Subtraction assignment (-=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/super\">super</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/this\">this</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/typeof\">typeof</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Unary_negation\">Unary negation (-)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Unary_plus\">Unary plus (+)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift\">Unsigned right shift (>>>)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/Unsigned_right_shift_assignment\">Unsigned right shift assignment (>>>=)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/void\">void operator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/yield\">yield</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Operators/yield*\">yield*</a></li></ol></details></li><li class=\"toggle\"><details><summary>Statements & declarations</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/async_function\">async function</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/async_function*\">async function*</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/block\">Block statement</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/break\">break</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/class\">class</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/const\">const</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/continue\">continue</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/debugger\">debugger</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/do...while\">do...while</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/Empty\">Empty statement</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/export\">export</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/Expression_statement\">Expression statement</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/for\">for</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of\">for await...of</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/for...in\">for...in</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/for...of\">for...of</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/function\">function</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/function*\">function*</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/if...else\">if...else</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/import\">import</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/label\">Labeled statement</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/let\">let</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/return\">return</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/switch\">switch</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/throw\">throw</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/try...catch\">try...catch</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/var\">var</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/while\">while</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Statements/with\">with</a><abbr class=\"icon icon-deprecated\" title=\"Deprecated. Not for use in new websites.\">\n<span class=\"visually-hidden\">Deprecated</span>\n</abbr></li></ol></details></li><li class=\"toggle\"><details><summary>Functions</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions\">Arrow function expressions</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters\">Default parameters</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/get\">get</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions\">Method definitions</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters\">Rest parameters</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/set\">set</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Functions/arguments\">The arguments object</a></li></ol></details></li><li class=\"toggle\"><details><summary>Classes</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes/constructor\">constructor</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes/extends\">extends</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes/Private_properties\">Private properties</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields\">Public class fields</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes/static\">static</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks\">Static initialization blocks</a></li></ol></details></li><li class=\"toggle\"><details><summary>Regular expressions</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Backreference\">Backreference: \\1, \\2</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Capturing_group\">Capturing group: (...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class_escape\">Character class escape: \\d, \\D, \\w, \\W, \\s, \\S</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_class\">Character class: [...], [^...]</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Character_escape\">Character escape: \\n, \\u{...}</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Disjunction\">Disjunction: |</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Input_boundary_assertion\">Input boundary assertion: ^, $</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Literal_character\">Literal character: a, b</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookahead_assertion\">Lookahead assertion: (?=...), (?!...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Lookbehind_assertion\">Lookbehind assertion: (?<=...), (?<!...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Modifier\">Modifier: (?ims-ims:...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Named_backreference\">Named backreference: \\k<name></a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Named_capturing_group\">Named capturing group: (?<name>...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Non-capturing_group\">Non-capturing group: (?:...)</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Quantifier\">Quantifier: *, +, ?, {n}, {n,}, {n,m}</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Unicode_character_class_escape\">Unicode character class escape: \\p{...}, \\P{...}</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Wildcard\">Wildcard: .</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Word_boundary_assertion\">Word boundary assertion: \\b, \\B</a></li></ol></details></li><li class=\"toggle\"><details><summary>Errors</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors\">Overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Promise_any_all_rejected\">AggregateError: No Promise in Promise.any was resolved</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Property_access_denied\">Error: Permission denied to access property \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Too_much_recursion\">InternalError: too much recursion</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_valid_code_point\">RangeError: argument is not a valid code point</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_division_by_zero\">RangeError: BigInt division by zero</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_negative_exponent\">RangeError: BigInt negative exponent</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Form_must_be_one_of\">RangeError: form must be one of 'NFC', 'NFD', 'NFKC', or 'NFKD'</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\">RangeError: invalid array length</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_date\">RangeError: invalid date</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Precision_range\">RangeError: precision is out of range</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_radix\">RangeError: radix must be an integer</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Resulting_string_too_large\">RangeError: repeat count must be less than infinity</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Negative_repetition_count\">RangeError: repeat count must be non-negative</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_be_converted_to_BigInt_because_it_isnt_an_integer\">RangeError: x can't be converted to BigInt because it isn't an integer</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Not_defined\">ReferenceError: \"x\" is not defined</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_var\">ReferenceError: assignment to undeclared variable \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_lexical_declaration_before_init\">ReferenceError: can't access lexical declaration 'X' before initialization</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_caller_or_arguments_usage\">ReferenceError: deprecated caller or arguments usage</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Super_not_called\">ReferenceError: must call super constructor before using 'this' in derived class constructor</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Super_called_twice\">ReferenceError: super() called twice in derived class constructor</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_strict_arguments_eval\">SyntaxError: 'arguments'/'eval' can't be defined or assigned to in strict mode code</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_octal_literal\">SyntaxError: \"0\"-prefixed octal literals are deprecated</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Strict_non_simple_params\">SyntaxError: \"use strict\" not allowed in function with non-simple parameters</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Reserved_identifier\">SyntaxError: \"x\" is a reserved identifier</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_backslash_at_end_of_pattern\">SyntaxError: \\ at end of pattern</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_for-of_initializer\">SyntaxError: a declaration in the head of a for-of loop can't have an initializer</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Delete_in_strict_mode\">SyntaxError: applying the 'delete' operator to an unqualified name is deprecated</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Arguments_not_allowed\">SyntaxError: arguments is not valid in fields</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_await\">SyntaxError: await is only valid in async functions, async generators and modules</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/await_yield_in_parameter\">SyntaxError: await/yield expression can't be used in parameter</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_use_nullish_coalescing_unparenthesized\">SyntaxError: cannot use `??` unparenthesized within `||` and `&&` expressions</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_character_class_escape_in_class_range\">SyntaxError: character class escape cannot be used in class range in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_continue\">SyntaxError: continue must be inside loop</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_duplicate_capture_group_name\">SyntaxError: duplicate capture group name in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Duplicate_parameter\">SyntaxError: duplicate formal argument x</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_for-in_initializer\">SyntaxError: for-in loop head declarations may not have initializers</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Unnamed_function_statement\">SyntaxError: function statement requires a name</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Function_label\">SyntaxError: functions cannot be labelled</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Either_be_both_static_or_non-static\">SyntaxError: getter and setter for private name #x should either be both static or non-static</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Getter_no_arguments\">SyntaxError: getter functions must have no arguments</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Identifier_after_number\">SyntaxError: identifier starts immediately after numeric literal</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Illegal_character\">SyntaxError: illegal character</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/import_decl_module_top_level\">SyntaxError: import declarations may only appear at top level of a module</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_incomplete_quantifier\">SyntaxError: incomplete quantifier in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_assignment_left-hand_side\">SyntaxError: invalid assignment left-hand side</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_BigInt_syntax\">SyntaxError: invalid BigInt syntax</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_capture_group_name\">SyntaxError: invalid capture group name in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_char_in_class\">SyntaxError: invalid character in class in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_class_set_operation\">SyntaxError: invalid class set operation in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_decimal_escape\">SyntaxError: invalid decimal escape in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_identity_escape\">SyntaxError: invalid identity escape in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_named_capture_reference\">SyntaxError: invalid named capture reference in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_property_name\">SyntaxError: invalid property name in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_range_in_character_class\">SyntaxError: invalid range in character class</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_group\">SyntaxError: invalid regexp group</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_regexp_flag\">SyntaxError: invalid regular expression flag \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_invalid_unicode_escape\">SyntaxError: invalid unicode escape in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/JSON_bad_parse\">SyntaxError: JSON.parse: bad parsing</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Label_not_found\">SyntaxError: label not found</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_colon_after_property_id\">SyntaxError: missing : after property id</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_parenthesis_after_argument_list\">SyntaxError: missing ) after argument list</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_parenthesis_after_condition\">SyntaxError: missing ) after condition</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_bracket_after_list\">SyntaxError: missing ] after element list</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_curly_after_function_body\">SyntaxError: missing } after function body</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_curly_after_property_list\">SyntaxError: missing } after property list</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_initializer_in_const\">SyntaxError: missing = in const declaration</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_formal_parameter\">SyntaxError: missing formal parameter</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Missing_name_after_dot_operator\">SyntaxError: missing name after . operator</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/No_variable_name\">SyntaxError: missing variable name</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_negated_char_class_with_strings\">SyntaxError: negated character class with strings in regular expression</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_new_optional\">SyntaxError: new keyword cannot be used with an optional chain</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_nothing_to_repeat\">SyntaxError: nothing to repeat</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_numbers_out_of_order_in_quantifier\">SyntaxError: numbers out of order in {} quantifier.</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_octal_escape_sequence\">SyntaxError: octal escape sequences can't be used in untagged template literals or in strict mode code</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Parameter_after_rest_parameter\">SyntaxError: parameter after rest parameter</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_delete_private_fields\">SyntaxError: private fields can't be deleted</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Duplicate_proto\">SyntaxError: property name __proto__ appears more than once in object literal</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Regex_raw_bracket\">SyntaxError: raw bracket is not allowed in regular expression with unicode flag</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Redeclared_parameter\">SyntaxError: redeclaration of formal parameter \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Undeclared_private_field_or_method\">SyntaxError: reference to undeclared private field or method #x</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Rest_with_default\">SyntaxError: rest parameter may not have a default</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_return\">SyntaxError: return not in function</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Setter_one_argument\">SyntaxError: setter functions must have one argument</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/String_literal_EOL\">SyntaxError: string literal contains an unescaped line break</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_super_call\">SyntaxError: super() is only valid in derived class constructors</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_optional_template\">SyntaxError: tagged template cannot be used with optional chain</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Hash_outside_class\">SyntaxError: Unexpected '#' used outside of class body</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_token\">SyntaxError: Unexpected token</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_break\">SyntaxError: unlabeled break must be inside loop or switch</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Unparenthesized_unary_expr_lhs_exponentiation\">SyntaxError: unparenthesized unary expression can't appear on the left-hand side of '**'</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Bad_super_prop\">SyntaxError: use of super property/member accesses only valid within methods or eval code within methods</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Deprecated_source_map_pragma\">SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/is_not_iterable\">TypeError: 'x' is not iterable</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Unexpected_type\">TypeError: \"x\" is (not) \"y\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_constructor\">TypeError: \"x\" is not a constructor</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Not_a_function\">TypeError: \"x\" is not a function</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/No_non-null_object\">TypeError: \"x\" is not a non-null object</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Read-only\">TypeError: \"x\" is read-only</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/BigInt_not_serializable\">TypeError: BigInt value can't be serialized in JSON</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Builtin_ctor_no_new\">TypeError: calling a builtin X constructor without new is forbidden</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Get_set_missing_private\">TypeError: can't access/set private field or method: object is not the right class</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_assign_to_property\">TypeError: can't assign to property \"x\" on \"y\": not an object</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_convert_BigInt_to_number\">TypeError: can't convert BigInt to number</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_convert_x_to_BigInt\">TypeError: can't convert x to BigInt</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_define_property_object_not_extensible\">TypeError: can't define property \"x\": \"obj\" is not extensible</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Non_configurable_array_element\">TypeError: can't delete non-configurable array element</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_redefine_property\">TypeError: can't redefine non-configurable property \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_set_prototype\">TypeError: can't set prototype of this object</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_prototype\">TypeError: can't set prototype: it would cause a prototype chain cycle</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/in_operator_no_object\">TypeError: cannot use 'in' operator to search for 'x' in 'y'</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Class_ctor_no_new\">TypeError: class constructors must be invoked with 'new'</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cyclic_object_value\">TypeError: cyclic object value</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_derived_return\">TypeError: derived class constructor returned invalid value x</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Private_setter_only\">TypeError: getting private setter-only property</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Private_double_initialization\">TypeError: Initializing an object twice is an error with private fields/methods</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/invalid_right_hand_side_instanceof_operand\">TypeError: invalid 'instanceof' operand 'x'</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Array_sort_argument\">TypeError: invalid Array.prototype.sort argument</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_const_assignment\">TypeError: invalid assignment to const \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Constructor_cant_be_used_directly\">TypeError: Iterator/AsyncIterator constructor can't be used directly</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Requires_global_RegExp\">TypeError: matchAll/replaceAll must be called with a global RegExp</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/More_arguments_needed\">TypeError: More arguments needed</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/No_properties\">TypeError: null/undefined has no properties</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Cant_delete\">TypeError: property \"x\" is non-configurable and can't be deleted</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Reduce_of_empty_array_with_no_initial_value\">TypeError: Reduce of empty array with no initial value</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only\">TypeError: setting getter-only property \"x\"</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Key_not_weakly_held\">TypeError: WeakSet key/WeakMap value 'x' must be an object or an unregistered symbol</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Called_on_incompatible_type\">TypeError: X.prototype.y called on incompatible type</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Malformed_URI\">URIError: malformed URI sequence</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Already_has_pragma\">Warning: -file- is being assigned a //# sourceMappingURL, but already has one</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Errors/Stmt_after_return\">Warning: unreachable code after return statement</a></li></ol></details></li><li class=\"toggle\"><details><summary>Misc</summary><ol><li><a href=\"/en-US/docs/Web/JavaScript/JavaScript_technologies_overview\">JavaScript technologies overview</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Lexical_grammar\">Lexical grammar</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Iteration_protocols\">Iteration protocols</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Strict_mode\">Strict mode</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Template_literals\">Template literals</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Trailing_commas\">Trailing commas</a></li><li><a href=\"/en-US/docs/Web/JavaScript/Reference/Deprecated_and_obsolete_features\">Deprecated features</a></li></ol></details></li></ol>","source":{"folder":"en-us/web/javascript/data_structures","github_url":"https://github.com/mdn/content/blob/main/files/en-us/web/javascript/data_structures/index.md","last_commit_url":"https://github.com/mdn/content/commit/a4e9bce1e8bac1b845b32536e0e44f335233eab6","filename":"index.md"},"summary":"Programming languages all have built-in data structures, but these often differ from one language to another. This article attempts to list the built-in data structures available in JavaScript and what properties they have. These can be used to build other data structures.","title":"JavaScript data types and data structures","toc":[{"text":"Dynamic and weak typing","id":"dynamic_and_weak_typing"},{"text":"Primitive values","id":"primitive_values"},{"text":"Objects","id":"objects"},{"text":"Type coercion","id":"type_coercion"},{"text":"See also","id":"see_also"}],"pageType":"guide"}}</script> <script>function gtElInit() {var lib = new google.translate.TranslateService();lib.translatePage('pl', 'tr', function () {});}</script> <script src="https://translate.google.com/translate_a/element.js?cb=gtElInit&hl=en-GB&client=wt" type="text/javascript"></script> </body> </html>