{"id":302,"date":"2022-10-14T19:51:16","date_gmt":"2022-10-14T11:51:16","guid":{"rendered":"https:\/\/islandtropicaman.com\/wp\/?p=302"},"modified":"2022-10-14T19:51:16","modified_gmt":"2022-10-14T11:51:16","slug":"create-a-typescript-function-to-multiply-three-numbers-and-returns-the-outcome","status":"publish","type":"post","link":"https:\/\/islandtropicaman.com\/wp\/2022\/10\/14\/create-a-typescript-function-to-multiply-three-numbers-and-returns-the-outcome\/","title":{"rendered":"Create a TypeScript function to multiply three numbers and returns the outcome"},"content":{"rendered":"<p>In this typescript example let us create a typescript function that will multiply three numbers and returns the outcome to the console.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction multiply(a:number, b:number, c:number) : number {\r\n    return a * b * c\r\n}\r\n\r\nconsole.log(multiply(2,3,5)) \r\n<\/pre>\n<p>The above function will produce the below outcome:-<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n30\r\n<\/pre>\n<p>Now let us analyze the program above line by line.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nfunction multiply(a:number, b:number, c:number) : number {}\r\n<\/pre>\n<p>The typescript function header consists of the keyword function to indicate that it is a typescript&#8217;s function. The function will return a number that has been indicated by the type number at the end of the function. There are three parameters within that function header and all of them are type numbers.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nreturn a * b * c\r\n<\/pre>\n<p>At last, all those numbers get multiplied and returned to the console object which will then print the outcome on the terminal with its log method.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this typescript example let us create a typescript function that will multiply three numbers and returns the outcome to the console. function multiply(a:number, b:number, c:number) : number { return a * b * c } console.log(multiply(2,3,5)) The above function will produce the below outcome:- 30 Now let us analyze the program above line by&#8230;<\/p>\n<p class=\"more-link-wrap\"><a href=\"https:\/\/islandtropicaman.com\/wp\/2022\/10\/14\/create-a-typescript-function-to-multiply-three-numbers-and-returns-the-outcome\/\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> &ldquo;Create a TypeScript function to multiply three numbers and returns the outcome&rdquo;<\/span> &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[42],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-type-script","tag-typescript-function"],"blog_post_layout_featured_media_urls":{"thumbnail":"","full":""},"categories_names":{"38":{"name":"Type-Script","link":"https:\/\/islandtropicaman.com\/wp\/category\/type-script\/"}},"tags_names":{"42":{"name":"typescript function","link":"https:\/\/islandtropicaman.com\/wp\/tag\/typescript-function\/"}},"comments_number":"0","_links":{"self":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":1,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":303,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/posts\/302\/revisions\/303"}],"wp:attachment":[{"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/islandtropicaman.com\/wp\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}