{"id":7438,"date":"2021-08-05T10:45:37","date_gmt":"2021-08-05T10:45:37","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=7438"},"modified":"2022-04-13T16:30:46","modified_gmt":"2022-04-13T16:30:46","slug":"how-many-data-types-how-to-work-are-there-in-javascript","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/","title":{"rendered":"How many data types How to work are there in JavaScript?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Boolean<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Boolean is the built-in object corresponding to the primitive Boolean data type. JavaScript boolean can have one of two values: true or false.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Primitive Values<\/strong><br>var primitiveTrue = true;<br>var primitiveFalse = false;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Boolean Function<\/strong><br>var functionTrue = Boolean(true);<br>var functionFalse = Boolean(flase);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Boolean Constructor<\/strong><br>var constructorTrue = new Boolean(true);<br>var constructorFalse = new Boolean(false);<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Boolean<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If value parameter is omitted or is 0, -0, null, false, NaN, undefined, or the empty string (&#8220;&#8221;), the object has an initial value of false.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/149d829402181963bffc92313c32e4d6.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">String<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A string is a built-in object corresponding to the primitive string data type.<br>A string is a group of characters.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/e22c234d07a5f24dc19550bb16fb8b14.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">String<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Primitive<\/strong><br>var str = \u201cHello DevopsSchool\u201d;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br>var str = \u201eHello DevopsSchool\u201f; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<span class=\"has-inline-color has-vivid-red-color\"><strong>String<\/strong>  <\/span>                            <br>var str = <code>Hello DevopsSchool<\/code>;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Constructor<\/strong><br>var str = new String (\u201cHello DevopsSchool\u201d);&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br>var str = new String (\u201eHello DevopsSchool\u201f); &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; <strong><span class=\"has-inline-color has-vivid-red-color\">Object<\/span><\/strong><br>var str = new String (<code>Hello DevopsSchool<\/code>);&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Accessing String<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/d9de724475c9a5f09d11dde67c556711.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Access String<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/8bf9dbed141c4f1799ee05122abc2a4f.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">String Concatenation<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/e61aeaac3ea8c3fffe376bb48e3b8951.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Concat Operator<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/8fe6fe63a556501fb121ec01c467ce39.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Template Literal\/ Template Strings<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Template literals are string literals allowing embedded expressions. You can<br>use multi-line strings and string interpolation features with them.<br>Template literals are enclosed by the back-tick () character instead of double<br>or single quotes.<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/8813bef0d5f6e346641f1999082de306.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Multiple Line String<\/h2>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/95e4a8c299de7dfbca20d43a38485ddd.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">String Interpolation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Template literals can contain placeholders. These are indicated by the dollar sign and curly braces<br>(${expression})<\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/vijaypk376\/181a6c09db73f4cf00998e8ade06fb15.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">String Methods<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>charAt ( )<\/strong><\/li><li><strong>charCodeAt( )<\/strong><\/li><li><strong>toUpperCase( )<\/strong><\/li><li><strong>toLowerCase ( )<\/strong><\/li><li><strong>Trim( )<\/strong><\/li><li><strong>Replace ( )<\/strong><\/li><li><strong>Split ( )<\/strong><\/li><li><strong>indexOf( )<\/strong><\/li><li><strong>Search ( )<\/strong><\/li><li><strong>Slice ( )<\/strong><\/li><li><strong>Substring( )<\/strong><\/li><li><strong>Substr ()<\/strong><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Boolean Boolean is the built-in object corresponding to the primitive Boolean data type. JavaScript boolean can have one of two [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[16],"tags":[5950,5949,5147,5095,466],"class_list":["post-7438","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-accessing-string","tag-boolean","tag-data-types","tag-javascript","tag-string"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How many data types How to work are there in JavaScript? - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How many data types How to work are there in JavaScript? - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"Boolean Boolean is the built-in object corresponding to the primitive Boolean data type. JavaScript boolean can have one of two [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-05T10:45:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-13T16:30:46+00:00\" \/>\n<meta name=\"author\" content=\"rajeshkumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"rajeshkumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/\"},\"author\":{\"name\":\"rajeshkumar\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"headline\":\"How many data types How to work are there in JavaScript?\",\"datePublished\":\"2021-08-05T10:45:37+00:00\",\"dateModified\":\"2022-04-13T16:30:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/\"},\"wordCount\":224,\"commentCount\":0,\"keywords\":[\"Accessing String\",\"Boolean\",\"data types\",\"Javascript\",\"String\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/\",\"name\":\"How many data types How to work are there in JavaScript? - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-08-05T10:45:37+00:00\",\"dateModified\":\"2022-04-13T16:30:46+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/how-many-data-types-how-to-work-are-there-in-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How many data types How to work are there in JavaScript?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/a40e0dd38feee7c2779460a804d49361\",\"name\":\"rajeshkumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g\",\"caption\":\"rajeshkumar\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/rajeshkumar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How many data types How to work are there in JavaScript? - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"How many data types How to work are there in JavaScript? - scmGalaxy","og_description":"Boolean Boolean is the built-in object corresponding to the primitive Boolean data type. JavaScript boolean can have one of two [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/","og_site_name":"scmGalaxy","article_published_time":"2021-08-05T10:45:37+00:00","article_modified_time":"2022-04-13T16:30:46+00:00","author":"rajeshkumar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"rajeshkumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/"},"author":{"name":"rajeshkumar","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"headline":"How many data types How to work are there in JavaScript?","datePublished":"2021-08-05T10:45:37+00:00","dateModified":"2022-04-13T16:30:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/"},"wordCount":224,"commentCount":0,"keywords":["Accessing String","Boolean","data types","Javascript","String"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/","name":"How many data types How to work are there in JavaScript? - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-08-05T10:45:37+00:00","dateModified":"2022-04-13T16:30:46+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/how-many-data-types-how-to-work-are-there-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"How many data types How to work are there in JavaScript?"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/a40e0dd38feee7c2779460a804d49361","name":"rajeshkumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/82337e1fc8642c7f36795aa0775af055a4f38882994004b593efd31758d4434e?s=96&d=mm&r=g","caption":"rajeshkumar"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/rajeshkumar\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/7438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=7438"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/7438\/revisions"}],"predecessor-version":[{"id":7439,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/7438\/revisions\/7439"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=7438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=7438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=7438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}