{
    "componentChunkName": "component---src-pages-post-js",
    "path": "/JavaScript-Complete-Notes-on-String/",
    "result": {"data":{"mdx":{"frontmatter":{"title":"JavaScript : Complete Notes on Strings","date":"March 2, 2022","tags":["react","js","css","gatsby","webpack"],"description":"this is the second blog post desctiption "},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"JavaScript : Complete Notes on Strings\",\n  \"date\": \"2022-03-02T23:46:37.121Z\",\n  \"description\": \"this is the second blog post desctiption \",\n  \"tags\": [\"react\", \"js\", \"css\", \"gatsby\", \"webpack\"],\n  \"type\": \"blog\"\n};\n\nvar makeShortcode = function makeShortcode(name) {\n  return function MDXDefaultShortcode(props) {\n    console.warn(\"Component \" + name + \" was not imported, exported, or provided by MDXProvider as global scope\");\n    return mdx(\"div\", props);\n  };\n};\n\nvar Callouts = makeShortcode(\"Callouts\");\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"h2\", null, \"Introduction\"), mdx(\"p\", null, \"A string is a sequence of charaters together encoded/surrounded in single quotes( ' ' ) or double quotes( \\\" \\\" ) or back ticks ( `` )\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"'Single Qotes String ' || \\\"Double Quotes String\\\" || `Back tick String` \"))), mdx(\"p\", null, \"As we know string contains escape charaters that can be interpreted when the string is printing\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"//expected => I'm Naresh\"), mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"console.log('I'm Naresh')\"), \" // error\"), mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \"console.log('I \\\\'m Naresh')\"))), mdx(\"hr\", null), mdx(\"h2\", null, \"String Properties\"), mdx(\"h4\", null, \"1. String Length\"), mdx(\"p\", null, \"In JavaScript Length is a Property of the String object and it is used to find the length/size of that string object.\"), mdx(\"p\", null, \"we can use this length property is Strings and Arrays\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \" console.log('Hello'.length); //5\")), mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, mdx(\"inlineCode\", {\n    parentName: \"p\"\n  }, \" console.log([1,2,3].length); //3\"))), mdx(Callouts, {\n    name: \"warning\",\n    mdxType: \"Callouts\"\n  }, \"String is a property ,not a method in JavaScript\", \" \"), mdx(\"h4\", null, \"2. String Constructor\"), mdx(\"p\", null, \"This property is used to return the string Constructor function for the object\"), mdx(\"h4\", null, \"3. String Propotype\"), mdx(\"p\", null, \"This property return the Propotype of the object which is derived from the object\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-jsx\",\n    \"metastring\": \"highlights=1,3-4 file=index.js\",\n    \"highlights\": \"1,3-4\",\n    \"file\": \"index.js\"\n  }, \"// here's a button in React!\\n<button\\n  onClick={() => {\\n    alert(\\\"Hello MDX!\\\");\\n  }}\\n>\\n  test\\n</button>\\n\")), mdx(\"hr\", null), mdx(\"h2\", null, \"String Methods\"), mdx(\"h4\", null, \"1. charAt(index)\"), mdx(\"p\", null, \"This method returns the Character at specified index of the String.\"), mdx(\"p\", null, \"console.log(\\\"Hello World\\\".charAt(1));\"), mdx(\"h4\", null, \"2. indexOf(value, index)\"), mdx(\"p\", null, \"is used ot return the index of the argument value in the String. It return the first occurance value only.If the value is not found in the String , then it returns the -1 as index.\"), mdx(\"pre\", null, mdx(\"code\", {\n    parentName: \"pre\",\n    \"className\": \"language-jsx\",\n    \"metastring\": \"file=style.jsx\",\n    \"file\": \"style.jsx\"\n  }, \"const Title = styled.h1(`\\n  font-size: 1.5em;\\n  text-align: center;\\n  color: palevioletred;\\n`);\\n\")), mdx(\"h3\", null, \"Summary\"), mdx(\"ol\", null, mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"length is a property of String\"), mdx(\"li\", {\n    parentName: \"ol\"\n  }, \"charAt(index) - finds the charater at a specified index.\")));\n}\n;\nMDXContent.isMDXComponent = true;"}},"pageContext":{"id":"251db276-8566-56cb-9bd9-96f10d045005","previousPostId":null,"nextPostId":null}},
    "staticQueryHashes": ["2033233798"]}