{"id":5590,"date":"2021-03-17T13:21:50","date_gmt":"2021-03-17T13:21:50","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=5590"},"modified":"2021-05-09T07:29:18","modified_gmt":"2021-05-09T07:29:18","slug":"function-in-javascript","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/","title":{"rendered":"Function in JavaScript"},"content":{"rendered":"\n<p class=\"has-medium-font-size wp-block-paragraph\"><strong>What is a Function in JavaScript<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A JavaScript function is a block of code designed to perform a particular task. In simple terms, Functions are used to make work easy, reduce the effort of coding multiple lines for the same task which is needed to repeat multiple times.  <\/p>\n\n\n\n<ol class=\"wp-block-list\"><li><strong>Function Declaration<\/strong><\/li><li><strong><strong>Function<\/strong><\/strong> <strong>Definition.<\/strong><\/li><li><strong><strong>Function<\/strong><\/strong> <strong>Call<\/strong><\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">In JavaScript function <em>declaration <\/em>and <em>definition <\/em>are done together.  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is a Function in JavaScript A JavaScript function is a block of code designed to perform a particular task. [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[16,156],"tags":[5142,5146,5144,5145],"class_list":["post-5590","post","type-post","status-publish","format-standard","hentry","category-javascript","category-websites","tag-function-in-javascript","tag-function-types-in-javascript","tag-functions","tag-how-to-make-javascript-function"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Function 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\/function-in-javascript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Function in JavaScript - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"What is a Function in JavaScript A JavaScript function is a block of code designed to perform a particular task. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-03-17T13:21:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-09T07:29:18+00:00\" \/>\n<meta name=\"author\" content=\"abhishek k\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"abhishek k\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/\"},\"author\":{\"name\":\"abhishek k\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/143500a93b88a96d3c9602b3df804cb6\"},\"headline\":\"Function in JavaScript\",\"datePublished\":\"2021-03-17T13:21:50+00:00\",\"dateModified\":\"2021-05-09T07:29:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/\"},\"wordCount\":66,\"commentCount\":1,\"keywords\":[\"Function in JavaScript\",\"function types in javascript\",\"functions\",\"how to make javascript function\"],\"articleSection\":[\"JavaScript\",\"Websites\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/\",\"name\":\"Function in JavaScript - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-03-17T13:21:50+00:00\",\"dateModified\":\"2021-05-09T07:29:18+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/143500a93b88a96d3c9602b3df804cb6\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/function-in-javascript\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Function 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\\\/143500a93b88a96d3c9602b3df804cb6\",\"name\":\"abhishek k\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7e05a074cc5eeb0b13b5768bbfd8f7793851f739965234dc5aaae590b9c8677f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7e05a074cc5eeb0b13b5768bbfd8f7793851f739965234dc5aaae590b9c8677f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7e05a074cc5eeb0b13b5768bbfd8f7793851f739965234dc5aaae590b9c8677f?s=96&d=mm&r=g\",\"caption\":\"abhishek k\"},\"description\":\"Abhishek is a full-stack developer that provides the solution for the design and analysis of Website and Mobile Application. Expertise in HTML, CSS, JAVASCRIPT, LARAVEL.\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/abhishek\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Function 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\/function-in-javascript\/","og_locale":"en_US","og_type":"article","og_title":"Function in JavaScript - scmGalaxy","og_description":"What is a Function in JavaScript A JavaScript function is a block of code designed to perform a particular task. [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/","og_site_name":"scmGalaxy","article_published_time":"2021-03-17T13:21:50+00:00","article_modified_time":"2021-05-09T07:29:18+00:00","author":"abhishek k","twitter_card":"summary_large_image","twitter_misc":{"Written by":"abhishek k"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/"},"author":{"name":"abhishek k","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/143500a93b88a96d3c9602b3df804cb6"},"headline":"Function in JavaScript","datePublished":"2021-03-17T13:21:50+00:00","dateModified":"2021-05-09T07:29:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/"},"wordCount":66,"commentCount":1,"keywords":["Function in JavaScript","function types in javascript","functions","how to make javascript function"],"articleSection":["JavaScript","Websites"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/","name":"Function in JavaScript - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-03-17T13:21:50+00:00","dateModified":"2021-05-09T07:29:18+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/143500a93b88a96d3c9602b3df804cb6"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/function-in-javascript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Function 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\/143500a93b88a96d3c9602b3df804cb6","name":"abhishek k","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7e05a074cc5eeb0b13b5768bbfd8f7793851f739965234dc5aaae590b9c8677f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7e05a074cc5eeb0b13b5768bbfd8f7793851f739965234dc5aaae590b9c8677f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7e05a074cc5eeb0b13b5768bbfd8f7793851f739965234dc5aaae590b9c8677f?s=96&d=mm&r=g","caption":"abhishek k"},"description":"Abhishek is a full-stack developer that provides the solution for the design and analysis of Website and Mobile Application. Expertise in HTML, CSS, JAVASCRIPT, LARAVEL.","url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/abhishek\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5590","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\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=5590"}],"version-history":[{"count":5,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5590\/revisions"}],"predecessor-version":[{"id":6144,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/5590\/revisions\/6144"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=5590"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=5590"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=5590"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}