{"id":103540,"date":"2022-03-15T03:37:00","date_gmt":"2022-03-15T01:37:01","guid":{"rendered":"https:\/\/prohoster.info\/blog\/novosti-interneta\/v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah"},"modified":"2022-03-15T03:37:00","modified_gmt":"2022-03-15T01:37:01","slug":"v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sv\/blog\/news\/v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah","title":{"rendered":"I JavaScript-spr\u00e5k f\u00f6resl\u00e5s det att l\u00e4gga till syntaktisk information om typer.","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>F\u00f6retagen Microsoft, Igalia och Bloomberg har initierat ett f\u00f6rslag att inkludera syntax f\u00f6r uttrycklig typdefinition i JavaScript-specifikationen, liknande den syntax som anv\u00e4nds i TypeScript. F\u00f6r n\u00e4rvarande har prototypen f\u00f6r \u00e4ndringarna f\u00f6reslagits f\u00f6r inkludering i ECMAScript-standarden och h\u00e5lls f\u00f6r prelimin\u00e4ra diskussioner (Stage 0). Vid det kommande m\u00f6tet i TC39-kommitt\u00e9n i mars planeras det att g\u00e5 vidare till den f\u00f6rsta granskningen av f\u00f6rslaget med medverkan av expertis fr\u00e5n ECMA.    <\/p>\n<p>Att ha tydlig information om typer kommer att undvika m\u00e5nga fel under utvecklingsprocessen, ge m\u00f6jlighet att anv\u00e4nda ytterligare optimeringstekniker, f\u00f6renkla fels\u00f6kning och g\u00f6ra koden mer l\u00e4sbar och enklare att vidareutveckla och underh\u00e5lla av andra utvecklare. Typst\u00f6d f\u00f6resl\u00e5s implementeras som en valfri funktion \u2014 JavaScript-motorer och runtime som inte st\u00f6der typkontroll kommer att ignorera typernas informationsannoteringar och behandla koden som tidigare, uppfattande typdata som kommentarer. Men verktyg f\u00f6r typkontroll kommer att kunna identifiera fel relaterade till felaktig anv\u00e4ndning av typer baserat p\u00e5 den tillg\u00e4ngliga informationen.    <\/p>\n<p>I motsats till typinformation som anges genom JSDoc-annotationer i form av kommentarer, kommer direkt typangivelse i variabeldefinitioner att g\u00f6ra koden mer \u00f6versk\u00e5dlig, tydlig och enklare att redigera. Till exempel kommer integrerade utvecklingsmilj\u00f6er som st\u00f6djer TypeScript omedelbart att markera fel i typad JavaScript-kod utan ytterligare omvandlingar. Dessutom ger inbyggt typst\u00f6d m\u00f6jlighet att k\u00f6ra program skrivna med typade JavaScript-dialekter som TypeScript och Flow utan transpilering mellan spr\u00e5ken.             <center><img decoding=\"async\" alt=\"I JavaScript-spr\u00e5k f\u00f6resl\u00e5s det att l\u00e4gga till syntaktisk information om typer.\" src=\"\/wp-content\/uploads\/2022\/03\/def4910b725831c1acf4c1ef1b2efca5.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/center>    <\/p>\n<p>\u0418\u0437 \u0442\u0438\u043f\u043e\u0432 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c &#171;string&#187;, &#171;number&#187; \u0438 &#171;boolean&#187;, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u043f\u043e\u043b\u0435\u0439 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 (&#171;number[]&#187;). \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 (&#171;string | number&#187;) \u0438 \u0434\u0436\u0435\u043d\u0435\u0440\u0438\u043a\u043e\u0432.         let x: string;       function add(a: number, b: number) {        return a + b;     }       interface Person {         name: string;         age: number;     }       function foo&lt;T&gt;(x: T) {        return x;     }       function foo(x: string | number): string | number {        if (typeof x === number) {            return x + 1        }        else {             return x + &#171;!&#187;        }     }<br \/>\n<br \/>K\u00e4lla: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/www.opennet.ru\/opennews\/art.shtml?num=56850\">opennet.ru<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, Igalia \u0438 Bloomberg \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u043e\u0439 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e JavaScript \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0434\u043b\u044f \u044f\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 TypeScript. \u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 ECMAScript, \u0432\u044b\u043d\u0435\u0441\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0439 (Stage 0). \u041d\u0430 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c \u043c\u0430\u0440\u0442\u043e\u0432\u0441\u043a\u043e\u043c \u0437\u0430\u0441\u0435\u0434\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u0438\u0442\u0435\u0442\u0430 TC39 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 \u043f\u0435\u0440\u0432\u0443\u044e \u0441\u0442\u0430\u0434\u0438\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":103541,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[702],"tags":[],"class_list":["post-103540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, Igalia \u0438 Bloomberg \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u043e\u0439 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e JavaScript \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0434\u043b\u044f \u044f\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 TypeScript.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sv\/blog\/news\/v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"sv_SE\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0412 \u044f\u0437\u044b\u043a JavaScript \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0442\u0438\u043f\u0430\u0445 | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, Igalia \u0438 Bloomberg \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u043e\u0439 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e JavaScript \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0434\u043b\u044f \u044f\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 TypeScript.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sv\/blog\/news\/v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-03-15T01:37:01+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-03-15T01:37:01+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Det f\u00f6resl\u00e5s att l\u00e4gga till syntaks med typinformation i JavaScript | ProHoster","description":"F\u00f6retagen Microsoft, Igalia och Bloomberg har initierat ett f\u00f6rslag att inkludera syntax f\u00f6r uttrycklig typdefinition i JavaScript-specifikationen, liknande den syntax som anv\u00e4nds i TypeScript.","canonical_url":"https:\/\/prohoster.info\/sv\/blog\/news\/v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sv_SE","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0412 \u044f\u0437\u044b\u043a JavaScript \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0442\u0438\u043f\u0430\u0445 | ProHoster","og:description":"\u041a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Microsoft, Igalia \u0438 Bloomberg \u0432\u044b\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0441 \u0438\u043d\u0438\u0446\u0438\u0430\u0442\u0438\u0432\u043e\u0439 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e JavaScript \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u0434\u043b\u044f \u044f\u0432\u043d\u043e\u0433\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432, \u043f\u043e\u0445\u043e\u0436\u0435\u0433\u043e \u043d\u0430 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u0432 \u044f\u0437\u044b\u043a\u0435 TypeScript.","og:url":"https:\/\/prohoster.info\/sv\/blog\/news\/v-yazyk-javascript-predlozheno-dobavit-sintaksis-s-informacziej-o-tipah","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2022-03-15T01:37:01+00:00","article:modified_time":"2022-03-15T01:37:01+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"103540","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2022-03-15 01:37:26","updated":"2022-10-04 10:50:21","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/posts\/103540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/comments?post=103540"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/posts\/103540\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/media\/103541"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/media?parent=103540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/categories?post=103540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sv\/wp-json\/wp\/v2\/tags?post=103540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}