CINXE.COM
JavaScript – Уикипедия
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="bg" dir="ltr"> <head> <meta charset="UTF-8"> <title>JavaScript – Уикипедия</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )bgwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":[",\t."," \t,"],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],"wgRequestId":"47d0b18b-bfc5-4cad-8dc0-3b6b1c4ec4e4","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"JavaScript","wgTitle":"JavaScript","wgCurRevisionId":12238974,"wgRevisionId":12238974,"wgArticleId":63292,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Статии за редактиране","JavaScript","Изобретения в САЩ"],"wgPageViewLanguage":"bg","wgPageContentLanguage":"bg","wgPageContentModel":"wikitext","wgRelevantPageName":"JavaScript","wgRelevantArticleId":63292,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia", "wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"bg","pageLanguageDir":"ltr","pageVariantFallbacks":"bg"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":true,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":20000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q2005","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={ "ext.gadget.WatchlistTopSectionWidgetFix":"ready","ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.cite.styles":"ready","ext.pygments":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","ext.pygments.view","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.QRpediaFix","ext.gadget.EditToolbar","ext.gadget.EditToolbar-menu-page_elements","ext.gadget.EditToolbar-menu-thematic_templates","ext.gadget.EditToolbar-menu-article_templates","ext.gadget.EditToolbar-menu-talk_templates", "ext.gadget.EditToolbar-menu-other_templates","ext.gadget.OpenStreetMap","ext.gadget.Switcher","ext.gadget.ParsePhabLinks","ext.gadget.Mwbot","ext.gadget.UploadRedirectToCommons","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=bg&modules=ext.cite.styles%7Cext.pygments%2CwikimediaBadges%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=bg&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=bg&modules=ext.gadget.WatchlistTopSectionWidgetFix&only=styles&skin=vector-2022"> <link rel="stylesheet" href="/w/load.php?lang=bg&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/1200px-Unofficial_JavaScript_logo_2.svg.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="1200"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/800px-Unofficial_JavaScript_logo_2.svg.png"> <meta property="og:image:width" content="800"> <meta property="og:image:height" content="800"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/640px-Unofficial_JavaScript_logo_2.svg.png"> <meta property="og:image:width" content="640"> <meta property="og:image:height" content="640"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="JavaScript – Уикипедия"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//bg.m.wikipedia.org/wiki/JavaScript"> <link rel="alternate" type="application/x-wiki" title="Редактиране" href="/w/index.php?title=JavaScript&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Уикипедия (bg)"> <link rel="EditURI" type="application/rsd+xml" href="//bg.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://bg.wikipedia.org/wiki/JavaScript"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.bg"> <link rel="alternate" type="application/atom+xml" title="Емисия на Atom за Уикипедия" href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%9F%D0%BE%D1%81%D0%BB%D0%B5%D0%B4%D0%BD%D0%B8_%D0%BF%D1%80%D0%BE%D0%BC%D0%B5%D0%BD%D0%B8&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-JavaScript rootpage-JavaScript skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Направо към съдържанието</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Сайт"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Главно меню" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Главно меню</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Главно меню</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">преместване към страничната лента</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">скриване</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Навигация </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage" class="mw-list-item"><a href="/wiki/%D0%9D%D0%B0%D1%87%D0%B0%D0%BB%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0" title="Началната страница [z]" accesskey="z"><span>Начална страница</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A1%D0%BB%D1%83%D1%87%D0%B0%D0%B9%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0" title="Зареждане на случайна страница [x]" accesskey="x"><span>Случайна статия</span></a></li> </ul> </div> </div> <div id="p-Полезно" class="vector-menu mw-portlet mw-portlet-Полезно" > <div class="vector-menu-heading"> Полезно </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-recentchanges" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%9F%D0%BE%D1%81%D0%BB%D0%B5%D0%B4%D0%BD%D0%B8_%D0%BF%D1%80%D0%BE%D0%BC%D0%B5%D0%BD%D0%B8" title="Списък на последните промени в уикито [r]" accesskey="r"><span>Последни промени</span></a></li><li id="n-Общи-разговори" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A0%D0%B0%D0%B7%D0%B3%D0%BE%D0%B2%D0%BE%D1%80%D0%B8"><span>Общи разговори</span></a></li><li id="n-Обсъждани-статии" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%90%D0%BA%D1%82%D0%B8%D0%B2%D0%BD%D0%B8_%D0%B1%D0%B5%D1%81%D0%B5%D0%B4%D0%B8"><span>Обсъждани статии</span></a></li><li id="n-Администратори" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%97%D0%B0%D1%8F%D0%B2%D0%BA%D0%B8_%D0%BA%D1%8A%D0%BC_%D0%B0%D0%B4%D0%BC%D0%B8%D0%BD%D0%B8%D1%81%D1%82%D1%80%D0%B0%D1%82%D0%BE%D1%80%D0%B8%D1%82%D0%B5"><span>Администратори</span></a></li><li id="n-Изтривания" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A1%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B8_%D0%B7%D0%B0_%D0%B8%D0%B7%D1%82%D1%80%D0%B8%D0%B2%D0%B0%D0%BD%D0%B5"><span>Изтривания</span></a></li><li id="n-За-контакти" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%97%D0%B0_%D0%BA%D0%BE%D0%BD%D1%82%D0%B0%D0%BA%D1%82%D0%B8"><span>За контакти</span></a></li> </ul> </div> </div> <div id="p-Включете_се!" class="vector-menu mw-portlet mw-portlet-Включете_се" > <div class="vector-menu-heading"> Включете се! </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-Защо?" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%9A%D0%BE%D0%B9_%D1%81%D1%8A%D0%B7%D0%B4%D0%B0%D0%B2%D0%B0_%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F"><span>Защо?</span></a></li><li id="n-help" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%9F%D1%8A%D1%80%D0%B2%D0%B8_%D1%81%D1%82%D1%8A%D0%BF%D0%BA%D0%B8" title="Място, където може да се информирате"><span>Помощ</span></a></li><li id="n-Картинки" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:10_%D0%BD%D0%B5%D1%89%D0%B0,_%D0%BA%D0%BE%D0%B8%D1%82%D0%BE_%D1%82%D1%80%D1%8F%D0%B1%D0%B2%D0%B0_%D0%B4%D0%B0_%D1%81%D0%B5_%D0%B7%D0%BD%D0%B0%D1%8F%D1%82_%D0%B7%D0%B0_%D0%BA%D0%B0%D1%80%D1%82%D0%B8%D0%BD%D0%BA%D0%B8%D1%82%D0%B5_%D0%B2_%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F"><span>Картинки</span></a></li><li id="n-Поведение" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%9F%D0%BE%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5"><span>Поведение</span></a></li><li id="n-Изпробване" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%9F%D1%8F%D1%81%D1%8A%D1%87%D0%BD%D0%B8%D0%BA"><span>Изпробване</span></a></li><li id="n-Нова-статия" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%92%D1%8A%D0%BB%D1%88%D0%B5%D0%B1%D0%BD%D0%B8%D0%BA"><span>Нова статия</span></a></li> </ul> </div> </div> <div id="p-Общувайте" class="vector-menu mw-portlet mw-portlet-Общувайте" > <div class="vector-menu-heading"> Общувайте </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-Блог-на-общността" class="mw-list-item"><a href="https://blog.wikimedia.bg/" rel="nofollow"><span>Блог на общността</span></a></li><li id="n-Фейсбук-страница" class="mw-list-item"><a href="https://www.facebook.com/WikipediaBG" rel="nofollow"><span>Фейсбук страница</span></a></li><li id="n-Фейсбук-група" class="mw-list-item"><a href="https://www.facebook.com/groups/WikipediaBG" rel="nofollow"><span>Фейсбук група</span></a></li><li id="n-🎮-Дискорд" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%94%D0%B8%D1%81%D0%BA%D0%BE%D1%80%D0%B4"><span>🎮 Дискорд</span></a></li><li id="n-Телеграм" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%A2%D0%B5%D0%BB%D0%B5%D0%B3%D1%80%D0%B0%D0%BC"><span>Телеграм</span></a></li><li id="n-IRC" class="mw-list-item"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:IRC"><span>IRC</span></a></li><li id="n-GitHub" class="mw-list-item"><a href="https://github.com/wikimedia-bg" rel="nofollow"><span>GitHub</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/%D0%9D%D0%B0%D1%87%D0%B0%D0%BB%D0%BD%D0%B0_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Уикипедия" src="/static/images/mobile/copyright/wikipedia-wordmark-bg.svg" style="width: 7.5em; height: 1.3125em;"> <img class="mw-logo-tagline" alt="Свободната енциклопедия" src="/static/images/mobile/copyright/wikipedia-tagline-bg.svg" width="120" height="12" style="width: 7.5em; height: 0.75em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A2%D1%8A%D1%80%D1%81%D0%B5%D0%BD%D0%B5" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Претърсване на Уикипедия [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Търсене</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Търсене в Уикипедия" aria-label="Търсене в Уикипедия" autocapitalize="sentences" title="Претърсване на Уикипедия [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Специални:Търсене"> </div> <button class="cdx-button cdx-search-input__end-button">Търсене</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Лични инструменти"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Облик"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Облик" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Облик</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_bg.wikipedia.org&uselang=bg" class=""><span>Направете дарение</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A1%D1%8A%D0%B7%D0%B4%D0%B0%D0%B2%D0%B0%D0%BD%D0%B5_%D0%BD%D0%B0_%D1%81%D0%BC%D0%B5%D1%82%D0%BA%D0%B0&returnto=JavaScript" title="Насърчаваме Ви да си създадете сметка и да влезете, въпреки че не е задължително." class=""><span>Създаване на сметка</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A0%D0%B5%D0%B3%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%B0%D0%BD%D0%B5_%D0%B8%D0%BB%D0%B8_%D0%B2%D0%BB%D0%B8%D0%B7%D0%B0%D0%BD%D0%B5&returnto=JavaScript" title="Препоръчваме Ви да влезете, въпреки, че не е задължително. [o]" accesskey="o" class=""><span>Влизане</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Допълнителни опции" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Лични инструменти" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Лични инструменти</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="Потребителско меню" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="//donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_bg.wikipedia.org&uselang=bg"><span>Направете дарение</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A1%D1%8A%D0%B7%D0%B4%D0%B0%D0%B2%D0%B0%D0%BD%D0%B5_%D0%BD%D0%B0_%D1%81%D0%BC%D0%B5%D1%82%D0%BA%D0%B0&returnto=JavaScript" title="Насърчаваме Ви да си създадете сметка и да влезете, въпреки че не е задължително."><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Създаване на сметка</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A0%D0%B5%D0%B3%D0%B8%D1%81%D1%82%D1%80%D0%B8%D1%80%D0%B0%D0%BD%D0%B5_%D0%B8%D0%BB%D0%B8_%D0%B2%D0%BB%D0%B8%D0%B7%D0%B0%D0%BD%D0%B5&returnto=JavaScript" title="Препоръчваме Ви да влезете, въпреки, че не е задължително. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Влизане</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Страници за излезли от системата редактори <a href="/wiki/%D0%9F%D0%BE%D0%BC%D0%BE%D1%89:%D0%92%D1%8A%D0%B2%D0%B5%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5" aria-label="Научете повече за редактирането"><span>научете повече</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%9C%D0%BE%D0%B8%D1%82%D0%B5_%D0%BF%D1%80%D0%B8%D0%BD%D0%BE%D1%81%D0%B8" title="Списък на промените, направени от този IP адрес [y]" accesskey="y"><span>Приноси</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%9C%D0%BE%D1%8F%D1%82%D0%B0_%D0%B1%D0%B5%D1%81%D0%B5%D0%B4%D0%B0" title="Дискусия относно редакциите от този адрес [n]" accesskey="n"><span>Беседа</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Сайт"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Съдържание" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Съдържание</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">преместване към страничната лента</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">скриване</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Начало</div> </a> </li> <li id="toc-История" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#История"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>История</span> </div> </a> <ul id="toc-История-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Описание" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Описание"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Описание</span> </div> </a> <button aria-controls="toc-Описание-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Превключване на подраздел Описание</span> </button> <ul id="toc-Описание-sublist" class="vector-toc-list"> <li id="toc-Възможности" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Възможности"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>Възможности</span> </div> </a> <ul id="toc-Възможности-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Разлики_с_Java" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Разлики_с_Java"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Разлики с Java</span> </div> </a> <ul id="toc-Разлики_с_Java-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Основи_на_езика" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Основи_на_езика"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Основи на езика</span> </div> </a> <button aria-controls="toc-Основи_на_езика-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Превключване на подраздел Основи на езика</span> </button> <ul id="toc-Основи_на_езика-sublist" class="vector-toc-list"> <li id="toc-Зареждане" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Зареждане"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>Зареждане</span> </div> </a> <ul id="toc-Зареждане-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Променливи" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Променливи"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2</span> <span>Променливи</span> </div> </a> <ul id="toc-Променливи-sublist" class="vector-toc-list"> <li id="toc-Имена_на_променливи" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Имена_на_променливи"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.1</span> <span>Имена на променливи</span> </div> </a> <ul id="toc-Имена_на_променливи-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Обхват_на_променливите" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Обхват_на_променливите"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.2</span> <span>Обхват на променливите</span> </div> </a> <ul id="toc-Обхват_на_променливите-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Константи" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Константи"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.3</span> <span>Константи</span> </div> </a> <ul id="toc-Константи-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Прости_типове_данни" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Прости_типове_данни"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.3</span> <span>Прости типове данни</span> </div> </a> <ul id="toc-Прости_типове_данни-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Оператори" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Оператори"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.4</span> <span>Оператори</span> </div> </a> <ul id="toc-Оператори-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Сложни_типове_данни" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Сложни_типове_данни"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.5</span> <span>Сложни типове данни</span> </div> </a> <ul id="toc-Сложни_типове_данни-sublist" class="vector-toc-list"> <li id="toc-Масиви" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Масиви"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.5.1</span> <span>Масиви</span> </div> </a> <ul id="toc-Масиви-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Функции" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Функции"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.5.2</span> <span>Функции</span> </div> </a> <ul id="toc-Функции-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Обекти" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Обекти"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.5.3</span> <span>Обекти</span> </div> </a> <ul id="toc-Обекти-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Чести_грешки_при_програмиране_с_JavaScript" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Чести_грешки_при_програмиране_с_JavaScript"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Чести грешки при програмиране с JavaScript</span> </div> </a> <ul id="toc-Чести_грешки_при_програмиране_с_JavaScript-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Източници" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Източници"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Източници</span> </div> </a> <ul id="toc-Източници-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Вижте_също" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Вижте_също"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Вижте също</span> </div> </a> <ul id="toc-Вижте_също-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Съдържание" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Скриване/показване на съдържанието" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Скриване/показване на съдържанието</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">JavaScript</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Към статията на друг език. Налична на 109 езика" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-109" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">109 езика</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-af mw-list-item"><a href="https://af.wikipedia.org/wiki/JavaScript" title="JavaScript – африканс" lang="af" hreflang="af" data-title="JavaScript" data-language-autonym="Afrikaans" data-language-local-name="африканс" class="interlanguage-link-target"><span>Afrikaans</span></a></li><li class="interlanguage-link interwiki-an mw-list-item"><a href="https://an.wikipedia.org/wiki/JavaScript" title="JavaScript – арагонски" lang="an" hreflang="an" data-title="JavaScript" data-language-autonym="Aragonés" data-language-local-name="арагонски" class="interlanguage-link-target"><span>Aragonés</span></a></li><li class="interlanguage-link interwiki-ang mw-list-item"><a href="https://ang.wikipedia.org/wiki/JavaScript" title="JavaScript – староанглийски" lang="ang" hreflang="ang" data-title="JavaScript" data-language-autonym="Ænglisc" data-language-local-name="староанглийски" class="interlanguage-link-target"><span>Ænglisc</span></a></li><li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D8%AC%D8%A7%D9%81%D8%A7_%D8%B3%D9%83%D8%B1%D9%8A%D8%A8%D8%AA" title="جافا سكريبت – арабски" lang="ar" hreflang="ar" data-title="جافا سكريبت" data-language-autonym="العربية" data-language-local-name="арабски" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-arz mw-list-item"><a href="https://arz.wikipedia.org/wiki/%D8%AC%D8%A7%D9%81%D8%A7_%D8%B3%D9%83%D8%B1%D9%8A%D8%A8%D8%AA" title="جافا سكريبت – Egyptian Arabic" lang="arz" hreflang="arz" data-title="جافا سكريبت" data-language-autonym="مصرى" data-language-local-name="Egyptian Arabic" class="interlanguage-link-target"><span>مصرى</span></a></li><li class="interlanguage-link interwiki-ast mw-list-item"><a href="https://ast.wikipedia.org/wiki/JavaScript" title="JavaScript – астурски" lang="ast" hreflang="ast" data-title="JavaScript" data-language-autonym="Asturianu" data-language-local-name="астурски" class="interlanguage-link-target"><span>Asturianu</span></a></li><li class="interlanguage-link interwiki-az mw-list-item"><a href="https://az.wikipedia.org/wiki/JavaScript" title="JavaScript – азербайджански" lang="az" hreflang="az" data-title="JavaScript" data-language-autonym="Azərbaycanca" data-language-local-name="азербайджански" class="interlanguage-link-target"><span>Azərbaycanca</span></a></li><li class="interlanguage-link interwiki-azb mw-list-item"><a href="https://azb.wikipedia.org/wiki/%D8%AC%D8%A7%D9%88%D8%A7%D8%A7%D8%B3%DA%A9%D8%B1%DB%8C%D9%BE%D8%AA" title="جاوااسکریپت – South Azerbaijani" lang="azb" hreflang="azb" data-title="جاوااسکریپت" data-language-autonym="تۆرکجه" data-language-local-name="South Azerbaijani" class="interlanguage-link-target"><span>تۆرکجه</span></a></li><li class="interlanguage-link interwiki-bat-smg mw-list-item"><a href="https://bat-smg.wikipedia.org/wiki/JavaScript" title="JavaScript – Samogitian" lang="sgs" hreflang="sgs" data-title="JavaScript" data-language-autonym="Žemaitėška" data-language-local-name="Samogitian" class="interlanguage-link-target"><span>Žemaitėška</span></a></li><li class="interlanguage-link interwiki-be mw-list-item"><a href="https://be.wikipedia.org/wiki/JavaScript" title="JavaScript – беларуски" lang="be" hreflang="be" data-title="JavaScript" data-language-autonym="Беларуская" data-language-local-name="беларуски" class="interlanguage-link-target"><span>Беларуская</span></a></li><li class="interlanguage-link interwiki-be-x-old mw-list-item"><a href="https://be-tarask.wikipedia.org/wiki/JavaScript" title="JavaScript – Belarusian (Taraškievica orthography)" lang="be-tarask" hreflang="be-tarask" data-title="JavaScript" data-language-autonym="Беларуская (тарашкевіца)" data-language-local-name="Belarusian (Taraškievica orthography)" class="interlanguage-link-target"><span>Беларуская (тарашкевіца)</span></a></li><li class="interlanguage-link interwiki-blk mw-list-item"><a href="https://blk.wikipedia.org/wiki/JavaScript" title="JavaScript – Pa'O" lang="blk" hreflang="blk" data-title="JavaScript" data-language-autonym="ပအိုဝ်ႏဘာႏသာႏ" data-language-local-name="Pa'O" class="interlanguage-link-target"><span>ပအိုဝ်ႏဘာႏသာႏ</span></a></li><li class="interlanguage-link interwiki-bn mw-list-item"><a href="https://bn.wikipedia.org/wiki/%E0%A6%9C%E0%A6%BE%E0%A6%AD%E0%A6%BE%E0%A6%B8%E0%A7%8D%E0%A6%95%E0%A7%8D%E0%A6%B0%E0%A6%BF%E0%A6%AA%E0%A7%8D%E0%A6%9F" title="জাভাস্ক্রিপ্ট – бенгалски" lang="bn" hreflang="bn" data-title="জাভাস্ক্রিপ্ট" data-language-autonym="বাংলা" data-language-local-name="бенгалски" class="interlanguage-link-target"><span>বাংলা</span></a></li><li class="interlanguage-link interwiki-br mw-list-item"><a href="https://br.wikipedia.org/wiki/Javascript" title="Javascript – бретонски" lang="br" hreflang="br" data-title="Javascript" data-language-autonym="Brezhoneg" data-language-local-name="бретонски" class="interlanguage-link-target"><span>Brezhoneg</span></a></li><li class="interlanguage-link interwiki-bug mw-list-item"><a href="https://bug.wikipedia.org/wiki/JavaScript" title="JavaScript – бугински" lang="bug" hreflang="bug" data-title="JavaScript" data-language-autonym="Basa Ugi" data-language-local-name="бугински" class="interlanguage-link-target"><span>Basa Ugi</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/JavaScript" title="JavaScript – каталонски" lang="ca" hreflang="ca" data-title="JavaScript" data-language-autonym="Català" data-language-local-name="каталонски" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-cdo mw-list-item"><a href="https://cdo.wikipedia.org/wiki/JavaScript" title="JavaScript – Mindong" lang="cdo" hreflang="cdo" data-title="JavaScript" data-language-autonym="閩東語 / Mìng-dĕ̤ng-ngṳ̄" data-language-local-name="Mindong" class="interlanguage-link-target"><span>閩東語 / Mìng-dĕ̤ng-ngṳ̄</span></a></li><li class="interlanguage-link interwiki-ckb mw-list-item"><a href="https://ckb.wikipedia.org/wiki/%D8%AC%D8%A7%DA%A4%D8%A7%D8%B3%DA%A9%D8%B1%DB%8C%D9%BE%D8%AA" title="جاڤاسکریپت – кюрдски (централен)" lang="ckb" hreflang="ckb" data-title="جاڤاسکریپت" data-language-autonym="کوردی" data-language-local-name="кюрдски (централен)" class="interlanguage-link-target"><span>کوردی</span></a></li><li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/JavaScript" title="JavaScript – чешки" lang="cs" hreflang="cs" data-title="JavaScript" data-language-autonym="Čeština" data-language-local-name="чешки" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-cv mw-list-item"><a href="https://cv.wikipedia.org/wiki/JavaScript" title="JavaScript – чувашки" lang="cv" hreflang="cv" data-title="JavaScript" data-language-autonym="Чӑвашла" data-language-local-name="чувашки" class="interlanguage-link-target"><span>Чӑвашла</span></a></li><li class="interlanguage-link interwiki-da mw-list-item"><a href="https://da.wikipedia.org/wiki/JavaScript" title="JavaScript – датски" lang="da" hreflang="da" data-title="JavaScript" data-language-autonym="Dansk" data-language-local-name="датски" class="interlanguage-link-target"><span>Dansk</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/JavaScript" title="JavaScript – немски" lang="de" hreflang="de" data-title="JavaScript" data-language-autonym="Deutsch" data-language-local-name="немски" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-el mw-list-item"><a href="https://el.wikipedia.org/wiki/JavaScript" title="JavaScript – гръцки" lang="el" hreflang="el" data-title="JavaScript" data-language-autonym="Ελληνικά" data-language-local-name="гръцки" class="interlanguage-link-target"><span>Ελληνικά</span></a></li><li class="interlanguage-link interwiki-en mw-list-item"><a href="https://en.wikipedia.org/wiki/JavaScript" title="JavaScript – английски" lang="en" hreflang="en" data-title="JavaScript" data-language-autonym="English" data-language-local-name="английски" class="interlanguage-link-target"><span>English</span></a></li><li class="interlanguage-link interwiki-eo mw-list-item"><a href="https://eo.wikipedia.org/wiki/JavaScript" title="JavaScript – есперанто" lang="eo" hreflang="eo" data-title="JavaScript" data-language-autonym="Esperanto" data-language-local-name="есперанто" class="interlanguage-link-target"><span>Esperanto</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/JavaScript" title="JavaScript – испански" lang="es" hreflang="es" data-title="JavaScript" data-language-autonym="Español" data-language-local-name="испански" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-et mw-list-item"><a href="https://et.wikipedia.org/wiki/JavaScript" title="JavaScript – естонски" lang="et" hreflang="et" data-title="JavaScript" data-language-autonym="Eesti" data-language-local-name="естонски" class="interlanguage-link-target"><span>Eesti</span></a></li><li class="interlanguage-link interwiki-eu mw-list-item"><a href="https://eu.wikipedia.org/wiki/JavaScript" title="JavaScript – баски" lang="eu" hreflang="eu" data-title="JavaScript" data-language-autonym="Euskara" data-language-local-name="баски" class="interlanguage-link-target"><span>Euskara</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D8%AC%D8%A7%D9%88%D8%A7%D8%A7%D8%B3%DA%A9%D8%B1%DB%8C%D9%BE%D8%AA" title="جاوااسکریپت – персийски" lang="fa" hreflang="fa" data-title="جاوااسکریپت" data-language-autonym="فارسی" data-language-local-name="персийски" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fi mw-list-item"><a href="https://fi.wikipedia.org/wiki/JavaScript" title="JavaScript – фински" lang="fi" hreflang="fi" data-title="JavaScript" data-language-autonym="Suomi" data-language-local-name="фински" class="interlanguage-link-target"><span>Suomi</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/JavaScript" title="JavaScript – френски" lang="fr" hreflang="fr" data-title="JavaScript" data-language-autonym="Français" data-language-local-name="френски" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-frr mw-list-item"><a href="https://frr.wikipedia.org/wiki/JavaScript" title="JavaScript – северен фризийски" lang="frr" hreflang="frr" data-title="JavaScript" data-language-autonym="Nordfriisk" data-language-local-name="северен фризийски" class="interlanguage-link-target"><span>Nordfriisk</span></a></li><li class="interlanguage-link interwiki-gl mw-list-item"><a href="https://gl.wikipedia.org/wiki/JavaScript" title="JavaScript – галисийски" lang="gl" hreflang="gl" data-title="JavaScript" data-language-autonym="Galego" data-language-local-name="галисийски" class="interlanguage-link-target"><span>Galego</span></a></li><li class="interlanguage-link interwiki-ha mw-list-item"><a href="https://ha.wikipedia.org/wiki/JavaScript" title="JavaScript – хауса" lang="ha" hreflang="ha" data-title="JavaScript" data-language-autonym="Hausa" data-language-local-name="хауса" class="interlanguage-link-target"><span>Hausa</span></a></li><li class="interlanguage-link interwiki-hak mw-list-item"><a href="https://hak.wikipedia.org/wiki/JavaScript" title="JavaScript – Hakka Chinese" lang="hak" hreflang="hak" data-title="JavaScript" data-language-autonym="客家語 / Hak-kâ-ngî" data-language-local-name="Hakka Chinese" class="interlanguage-link-target"><span>客家語 / Hak-kâ-ngî</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/JavaScript" title="JavaScript – иврит" lang="he" hreflang="he" data-title="JavaScript" data-language-autonym="עברית" data-language-local-name="иврит" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-hi mw-list-item"><a href="https://hi.wikipedia.org/wiki/%E0%A4%9C%E0%A4%BE%E0%A4%B5%E0%A4%BE%E0%A4%B8%E0%A5%8D%E0%A4%95%E0%A5%8D%E0%A4%B0%E0%A4%BF%E0%A4%AA%E0%A5%8D%E0%A4%9F" title="जावास्क्रिप्ट – хинди" lang="hi" hreflang="hi" data-title="जावास्क्रिप्ट" data-language-autonym="हिन्दी" data-language-local-name="хинди" class="interlanguage-link-target"><span>हिन्दी</span></a></li><li class="interlanguage-link interwiki-hr mw-list-item"><a href="https://hr.wikipedia.org/wiki/JavaScript" title="JavaScript – хърватски" lang="hr" hreflang="hr" data-title="JavaScript" data-language-autonym="Hrvatski" data-language-local-name="хърватски" class="interlanguage-link-target"><span>Hrvatski</span></a></li><li class="interlanguage-link interwiki-hu mw-list-item"><a href="https://hu.wikipedia.org/wiki/JavaScript" title="JavaScript – унгарски" lang="hu" hreflang="hu" data-title="JavaScript" data-language-autonym="Magyar" data-language-local-name="унгарски" class="interlanguage-link-target"><span>Magyar</span></a></li><li class="interlanguage-link interwiki-hy mw-list-item"><a href="https://hy.wikipedia.org/wiki/%D5%8B%D5%A1%D5%BE%D5%A1%D5%8D%D5%AF%D6%80%D5%AB%D5%BA%D5%BF" title="ՋավաՍկրիպտ – арменски" lang="hy" hreflang="hy" data-title="ՋավաՍկրիպտ" data-language-autonym="Հայերեն" data-language-local-name="арменски" class="interlanguage-link-target"><span>Հայերեն</span></a></li><li class="interlanguage-link interwiki-ia mw-list-item"><a href="https://ia.wikipedia.org/wiki/JavaScript" title="JavaScript – интерлингва" lang="ia" hreflang="ia" data-title="JavaScript" data-language-autonym="Interlingua" data-language-local-name="интерлингва" class="interlanguage-link-target"><span>Interlingua</span></a></li><li class="interlanguage-link interwiki-id mw-list-item"><a href="https://id.wikipedia.org/wiki/JavaScript" title="JavaScript – индонезийски" lang="id" hreflang="id" data-title="JavaScript" data-language-autonym="Bahasa Indonesia" data-language-local-name="индонезийски" class="interlanguage-link-target"><span>Bahasa Indonesia</span></a></li><li class="interlanguage-link interwiki-io mw-list-item"><a href="https://io.wikipedia.org/wiki/JavaScript" title="JavaScript – идо" lang="io" hreflang="io" data-title="JavaScript" data-language-autonym="Ido" data-language-local-name="идо" class="interlanguage-link-target"><span>Ido</span></a></li><li class="interlanguage-link interwiki-is mw-list-item"><a href="https://is.wikipedia.org/wiki/JavaScript" title="JavaScript – исландски" lang="is" hreflang="is" data-title="JavaScript" data-language-autonym="Íslenska" data-language-local-name="исландски" class="interlanguage-link-target"><span>Íslenska</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/JavaScript" title="JavaScript – италиански" lang="it" hreflang="it" data-title="JavaScript" data-language-autonym="Italiano" data-language-local-name="италиански" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/JavaScript" title="JavaScript – японски" lang="ja" hreflang="ja" data-title="JavaScript" data-language-autonym="日本語" data-language-local-name="японски" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-jv mw-list-item"><a href="https://jv.wikipedia.org/wiki/JavaScript" title="JavaScript – явански" lang="jv" hreflang="jv" data-title="JavaScript" data-language-autonym="Jawa" data-language-local-name="явански" class="interlanguage-link-target"><span>Jawa</span></a></li><li class="interlanguage-link interwiki-ka mw-list-item"><a href="https://ka.wikipedia.org/wiki/JavaScript" title="JavaScript – грузински" lang="ka" hreflang="ka" data-title="JavaScript" data-language-autonym="ქართული" data-language-local-name="грузински" class="interlanguage-link-target"><span>ქართული</span></a></li><li class="interlanguage-link interwiki-kaa mw-list-item"><a href="https://kaa.wikipedia.org/wiki/JavaScript" title="JavaScript – каракалпашки" lang="kaa" hreflang="kaa" data-title="JavaScript" data-language-autonym="Qaraqalpaqsha" data-language-local-name="каракалпашки" class="interlanguage-link-target"><span>Qaraqalpaqsha</span></a></li><li class="interlanguage-link interwiki-kab mw-list-item"><a href="https://kab.wikipedia.org/wiki/JavaScript" title="JavaScript – кабилски" lang="kab" hreflang="kab" data-title="JavaScript" data-language-autonym="Taqbaylit" data-language-local-name="кабилски" class="interlanguage-link-target"><span>Taqbaylit</span></a></li><li class="interlanguage-link interwiki-kk mw-list-item"><a href="https://kk.wikipedia.org/wiki/JavaScript" title="JavaScript – казахски" lang="kk" hreflang="kk" data-title="JavaScript" data-language-autonym="Қазақша" data-language-local-name="казахски" class="interlanguage-link-target"><span>Қазақша</span></a></li><li class="interlanguage-link interwiki-km mw-list-item"><a href="https://km.wikipedia.org/wiki/JavaScript" title="JavaScript – кхмерски" lang="km" hreflang="km" data-title="JavaScript" data-language-autonym="ភាសាខ្មែរ" data-language-local-name="кхмерски" class="interlanguage-link-target"><span>ភាសាខ្មែរ</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8" title="자바스크립트 – корейски" lang="ko" hreflang="ko" data-title="자바스크립트" data-language-autonym="한국어" data-language-local-name="корейски" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-ku mw-list-item"><a href="https://ku.wikipedia.org/wiki/JavaScript" title="JavaScript – кюрдски" lang="ku" hreflang="ku" data-title="JavaScript" data-language-autonym="Kurdî" data-language-local-name="кюрдски" class="interlanguage-link-target"><span>Kurdî</span></a></li><li class="interlanguage-link interwiki-ky mw-list-item"><a href="https://ky.wikipedia.org/wiki/JavaScript" title="JavaScript – киргизки" lang="ky" hreflang="ky" data-title="JavaScript" data-language-autonym="Кыргызча" data-language-local-name="киргизки" class="interlanguage-link-target"><span>Кыргызча</span></a></li><li class="interlanguage-link interwiki-la mw-list-item"><a href="https://la.wikipedia.org/wiki/JavaScript" title="JavaScript – латински" lang="la" hreflang="la" data-title="JavaScript" data-language-autonym="Latina" data-language-local-name="латински" class="interlanguage-link-target"><span>Latina</span></a></li><li class="interlanguage-link interwiki-lfn mw-list-item"><a href="https://lfn.wikipedia.org/wiki/JavaScript" title="JavaScript – Lingua Franca Nova" lang="lfn" hreflang="lfn" data-title="JavaScript" data-language-autonym="Lingua Franca Nova" data-language-local-name="Lingua Franca Nova" class="interlanguage-link-target"><span>Lingua Franca Nova</span></a></li><li class="interlanguage-link interwiki-lmo mw-list-item"><a href="https://lmo.wikipedia.org/wiki/JavaScript" title="JavaScript – ломбардски" lang="lmo" hreflang="lmo" data-title="JavaScript" data-language-autonym="Lombard" data-language-local-name="ломбардски" class="interlanguage-link-target"><span>Lombard</span></a></li><li class="interlanguage-link interwiki-lt mw-list-item"><a href="https://lt.wikipedia.org/wiki/JavaScript" title="JavaScript – литовски" lang="lt" hreflang="lt" data-title="JavaScript" data-language-autonym="Lietuvių" data-language-local-name="литовски" class="interlanguage-link-target"><span>Lietuvių</span></a></li><li class="interlanguage-link interwiki-lv mw-list-item"><a href="https://lv.wikipedia.org/wiki/JavaScript" title="JavaScript – латвийски" lang="lv" hreflang="lv" data-title="JavaScript" data-language-autonym="Latviešu" data-language-local-name="латвийски" class="interlanguage-link-target"><span>Latviešu</span></a></li><li class="interlanguage-link interwiki-mk mw-list-item"><a href="https://mk.wikipedia.org/wiki/JavaScript" title="JavaScript – македонски" lang="mk" hreflang="mk" data-title="JavaScript" data-language-autonym="Македонски" data-language-local-name="македонски" class="interlanguage-link-target"><span>Македонски</span></a></li><li class="interlanguage-link interwiki-ml mw-list-item"><a href="https://ml.wikipedia.org/wiki/%E0%B4%9C%E0%B4%BE%E0%B4%B5%E0%B4%BE%E0%B4%B8%E0%B5%8D%E0%B4%95%E0%B5%8D%E0%B4%B0%E0%B4%BF%E0%B4%AA%E0%B5%8D%E0%B4%B1%E0%B5%8D%E0%B4%B1%E0%B5%8D" title="ജാവാസ്ക്രിപ്റ്റ് – малаялам" lang="ml" hreflang="ml" data-title="ജാവാസ്ക്രിപ്റ്റ്" data-language-autonym="മലയാളം" data-language-local-name="малаялам" class="interlanguage-link-target"><span>മലയാളം</span></a></li><li class="interlanguage-link interwiki-mn mw-list-item"><a href="https://mn.wikipedia.org/wiki/JavaScript" title="JavaScript – монголски" lang="mn" hreflang="mn" data-title="JavaScript" data-language-autonym="Монгол" data-language-local-name="монголски" class="interlanguage-link-target"><span>Монгол</span></a></li><li class="interlanguage-link interwiki-mr mw-list-item"><a href="https://mr.wikipedia.org/wiki/%E0%A4%9C%E0%A4%BE%E0%A4%B5%E0%A4%BE%E0%A4%B8%E0%A5%8D%E0%A4%95%E0%A5%8D%E0%A4%B0%E0%A4%BF%E0%A4%AA%E0%A5%8D%E0%A4%9F" title="जावास्क्रिप्ट – марати" lang="mr" hreflang="mr" data-title="जावास्क्रिप्ट" data-language-autonym="मराठी" data-language-local-name="марати" class="interlanguage-link-target"><span>मराठी</span></a></li><li class="interlanguage-link interwiki-ms mw-list-item"><a href="https://ms.wikipedia.org/wiki/JavaScript" title="JavaScript – малайски" lang="ms" hreflang="ms" data-title="JavaScript" data-language-autonym="Bahasa Melayu" data-language-local-name="малайски" class="interlanguage-link-target"><span>Bahasa Melayu</span></a></li><li class="interlanguage-link interwiki-my mw-list-item"><a href="https://my.wikipedia.org/wiki/JavaScript" title="JavaScript – бирмански" lang="my" hreflang="my" data-title="JavaScript" data-language-autonym="မြန်မာဘာသာ" data-language-local-name="бирмански" class="interlanguage-link-target"><span>မြန်မာဘာသာ</span></a></li><li class="interlanguage-link interwiki-mzn mw-list-item"><a href="https://mzn.wikipedia.org/wiki/%D8%AC%D8%A7%D9%88%D8%A7%D8%A7%D8%B3%DA%A9%D8%B1%DB%8C%D9%BE%D8%AA" title="جاوااسکریپت – мазандерански" lang="mzn" hreflang="mzn" data-title="جاوااسکریپت" data-language-autonym="مازِرونی" data-language-local-name="мазандерански" class="interlanguage-link-target"><span>مازِرونی</span></a></li><li class="interlanguage-link interwiki-ne mw-list-item"><a href="https://ne.wikipedia.org/wiki/%E0%A4%9C%E0%A4%BE%E0%A4%AD%E0%A4%BE%E0%A4%B8%E0%A5%8D%E0%A4%95%E0%A5%8D%E0%A4%B0%E0%A4%BF%E0%A4%AA%E0%A5%8D%E0%A4%9F" title="जाभास्क्रिप्ट – непалски" lang="ne" hreflang="ne" data-title="जाभास्क्रिप्ट" data-language-autonym="नेपाली" data-language-local-name="непалски" class="interlanguage-link-target"><span>नेपाली</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/JavaScript" title="JavaScript – нидерландски" lang="nl" hreflang="nl" data-title="JavaScript" data-language-autonym="Nederlands" data-language-local-name="нидерландски" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-no mw-list-item"><a href="https://no.wikipedia.org/wiki/JavaScript" title="JavaScript – норвежки (букмол)" lang="nb" hreflang="nb" data-title="JavaScript" data-language-autonym="Norsk bokmål" data-language-local-name="норвежки (букмол)" class="interlanguage-link-target"><span>Norsk bokmål</span></a></li><li class="interlanguage-link interwiki-or mw-list-item"><a href="https://or.wikipedia.org/wiki/%E0%AC%9C%E0%AC%BE%E0%AC%AD%E0%AC%BE%E0%AC%B8%E0%AD%8D%E0%AC%95%E0%AD%8D%E0%AC%B0%E0%AC%BF%E0%AC%AA%E0%AD%8D%E0%AC%9F" title="ଜାଭାସ୍କ୍ରିପ୍ଟ – ория" lang="or" hreflang="or" data-title="ଜାଭାସ୍କ୍ରିପ୍ଟ" data-language-autonym="ଓଡ଼ିଆ" data-language-local-name="ория" class="interlanguage-link-target"><span>ଓଡ଼ିଆ</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/JavaScript" title="JavaScript – полски" lang="pl" hreflang="pl" data-title="JavaScript" data-language-autonym="Polski" data-language-local-name="полски" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pnb mw-list-item"><a href="https://pnb.wikipedia.org/wiki/%D8%AC%D8%A7%D9%88%D8%A7_%D8%B3%DA%A9%D8%B1%D9%BE%D9%B9" title="جاوا سکرپٹ – Western Punjabi" lang="pnb" hreflang="pnb" data-title="جاوا سکرپٹ" data-language-autonym="پنجابی" data-language-local-name="Western Punjabi" class="interlanguage-link-target"><span>پنجابی</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/JavaScript" title="JavaScript – португалски" lang="pt" hreflang="pt" data-title="JavaScript" data-language-autonym="Português" data-language-local-name="португалски" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-pwn mw-list-item"><a href="https://pwn.wikipedia.org/wiki/JavaScript" title="JavaScript – Paiwan" lang="pwn" hreflang="pwn" data-title="JavaScript" data-language-autonym="Pinayuanan" data-language-local-name="Paiwan" class="interlanguage-link-target"><span>Pinayuanan</span></a></li><li class="interlanguage-link interwiki-qu mw-list-item"><a href="https://qu.wikipedia.org/wiki/JavaScript" title="JavaScript – кечуа" lang="qu" hreflang="qu" data-title="JavaScript" data-language-autonym="Runa Simi" data-language-local-name="кечуа" class="interlanguage-link-target"><span>Runa Simi</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/JavaScript" title="JavaScript – румънски" lang="ro" hreflang="ro" data-title="JavaScript" data-language-autonym="Română" data-language-local-name="румънски" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/JavaScript" title="JavaScript – руски" lang="ru" hreflang="ru" data-title="JavaScript" data-language-autonym="Русский" data-language-local-name="руски" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sah mw-list-item"><a href="https://sah.wikipedia.org/wiki/JavaScript" title="JavaScript – саха" lang="sah" hreflang="sah" data-title="JavaScript" data-language-autonym="Саха тыла" data-language-local-name="саха" class="interlanguage-link-target"><span>Саха тыла</span></a></li><li class="interlanguage-link interwiki-sco mw-list-item"><a href="https://sco.wikipedia.org/wiki/JavaScript" title="JavaScript – шотландски" lang="sco" hreflang="sco" data-title="JavaScript" data-language-autonym="Scots" data-language-local-name="шотландски" class="interlanguage-link-target"><span>Scots</span></a></li><li class="interlanguage-link interwiki-sh mw-list-item"><a href="https://sh.wikipedia.org/wiki/JavaScript" title="JavaScript – сърбохърватски" lang="sh" hreflang="sh" data-title="JavaScript" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="сърбохърватски" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-si mw-list-item"><a href="https://si.wikipedia.org/wiki/%E0%B6%A2%E0%B7%8F%E0%B7%80%E0%B7%8F_%E0%B6%8B%E0%B6%B4%E0%B6%AF%E0%B7%9A%E0%B7%81%E0%B7%8F%E0%B7%80%E0%B6%BD%E0%B7%92%E0%B6%BA" title="ජාවා උපදේශාවලිය – синхалски" lang="si" hreflang="si" data-title="ජාවා උපදේශාවලිය" data-language-autonym="සිංහල" data-language-local-name="синхалски" class="interlanguage-link-target"><span>සිංහල</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/JavaScript" title="JavaScript – Simple English" lang="en-simple" hreflang="en-simple" data-title="JavaScript" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sk mw-list-item"><a href="https://sk.wikipedia.org/wiki/JavaScript" title="JavaScript – словашки" lang="sk" hreflang="sk" data-title="JavaScript" data-language-autonym="Slovenčina" data-language-local-name="словашки" class="interlanguage-link-target"><span>Slovenčina</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/JavaScript" title="JavaScript – словенски" lang="sl" hreflang="sl" data-title="JavaScript" data-language-autonym="Slovenščina" data-language-local-name="словенски" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-so mw-list-item"><a href="https://so.wikipedia.org/wiki/JavaScript" title="JavaScript – сомалийски" lang="so" hreflang="so" data-title="JavaScript" data-language-autonym="Soomaaliga" data-language-local-name="сомалийски" class="interlanguage-link-target"><span>Soomaaliga</span></a></li><li class="interlanguage-link interwiki-sq mw-list-item"><a href="https://sq.wikipedia.org/wiki/JavaScript" title="JavaScript – албански" lang="sq" hreflang="sq" data-title="JavaScript" data-language-autonym="Shqip" data-language-local-name="албански" class="interlanguage-link-target"><span>Shqip</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/JavaScript" title="JavaScript – сръбски" lang="sr" hreflang="sr" data-title="JavaScript" data-language-autonym="Српски / srpski" data-language-local-name="сръбски" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-su mw-list-item"><a href="https://su.wikipedia.org/wiki/JavaScript" title="JavaScript – сундански" lang="su" hreflang="su" data-title="JavaScript" data-language-autonym="Sunda" data-language-local-name="сундански" class="interlanguage-link-target"><span>Sunda</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Javascript" title="Javascript – шведски" lang="sv" hreflang="sv" data-title="Javascript" data-language-autonym="Svenska" data-language-local-name="шведски" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-sw mw-list-item"><a href="https://sw.wikipedia.org/wiki/JavaScript" title="JavaScript – суахили" lang="sw" hreflang="sw" data-title="JavaScript" data-language-autonym="Kiswahili" data-language-local-name="суахили" class="interlanguage-link-target"><span>Kiswahili</span></a></li><li class="interlanguage-link interwiki-ta mw-list-item"><a href="https://ta.wikipedia.org/wiki/%E0%AE%AF%E0%AE%BE%E0%AE%B5%E0%AE%BE%E0%AE%95%E0%AF%8D%E0%AE%95%E0%AE%BF%E0%AE%B1%E0%AE%BF%E0%AE%9F%E0%AF%8D%E0%AE%9F%E0%AF%81" title="யாவாக்கிறிட்டு – тамилски" lang="ta" hreflang="ta" data-title="யாவாக்கிறிட்டு" data-language-autonym="தமிழ்" data-language-local-name="тамилски" class="interlanguage-link-target"><span>தமிழ்</span></a></li><li class="interlanguage-link interwiki-te mw-list-item"><a href="https://te.wikipedia.org/wiki/%E0%B0%9C%E0%B0%BE%E0%B0%B5%E0%B0%BE%E0%B0%B8%E0%B1%8D%E0%B0%95%E0%B1%8D%E0%B0%B0%E0%B0%BF%E0%B0%AA%E0%B1%8D%E0%B0%9F%E0%B1%81" title="జావాస్క్రిప్టు – телугу" lang="te" hreflang="te" data-title="జావాస్క్రిప్టు" data-language-autonym="తెలుగు" data-language-local-name="телугу" class="interlanguage-link-target"><span>తెలుగు</span></a></li><li class="interlanguage-link interwiki-tet mw-list-item"><a href="https://tet.wikipedia.org/wiki/JavaScript" title="JavaScript – тетум" lang="tet" hreflang="tet" data-title="JavaScript" data-language-autonym="Tetun" data-language-local-name="тетум" class="interlanguage-link-target"><span>Tetun</span></a></li><li class="interlanguage-link interwiki-th mw-list-item"><a href="https://th.wikipedia.org/wiki/%E0%B8%88%E0%B8%B2%E0%B8%A7%E0%B8%B2%E0%B8%AA%E0%B8%84%E0%B8%A3%E0%B8%B4%E0%B8%9B%E0%B8%95%E0%B9%8C" title="จาวาสคริปต์ – тайски" lang="th" hreflang="th" data-title="จาวาสคริปต์" data-language-autonym="ไทย" data-language-local-name="тайски" class="interlanguage-link-target"><span>ไทย</span></a></li><li class="interlanguage-link interwiki-tk mw-list-item"><a href="https://tk.wikipedia.org/wiki/JavaScript" title="JavaScript – туркменски" lang="tk" hreflang="tk" data-title="JavaScript" data-language-autonym="Türkmençe" data-language-local-name="туркменски" class="interlanguage-link-target"><span>Türkmençe</span></a></li><li class="interlanguage-link interwiki-tl mw-list-item"><a href="https://tl.wikipedia.org/wiki/JavaScript" title="JavaScript – тагалог" lang="tl" hreflang="tl" data-title="JavaScript" data-language-autonym="Tagalog" data-language-local-name="тагалог" class="interlanguage-link-target"><span>Tagalog</span></a></li><li class="interlanguage-link interwiki-tr mw-list-item"><a href="https://tr.wikipedia.org/wiki/JavaScript" title="JavaScript – турски" lang="tr" hreflang="tr" data-title="JavaScript" data-language-autonym="Türkçe" data-language-local-name="турски" class="interlanguage-link-target"><span>Türkçe</span></a></li><li class="interlanguage-link interwiki-tt mw-list-item"><a href="https://tt.wikipedia.org/wiki/JavaScript" title="JavaScript – татарски" lang="tt" hreflang="tt" data-title="JavaScript" data-language-autonym="Татарча / tatarça" data-language-local-name="татарски" class="interlanguage-link-target"><span>Татарча / tatarça</span></a></li><li class="interlanguage-link interwiki-uk mw-list-item"><a href="https://uk.wikipedia.org/wiki/JavaScript" title="JavaScript – украински" lang="uk" hreflang="uk" data-title="JavaScript" data-language-autonym="Українська" data-language-local-name="украински" class="interlanguage-link-target"><span>Українська</span></a></li><li class="interlanguage-link interwiki-ur mw-list-item"><a href="https://ur.wikipedia.org/wiki/%D8%AC%D8%A7%D9%88%D8%A7_%D8%A7%D8%B3%DA%A9%D8%B1%D9%BE%D9%B9" title="جاوا اسکرپٹ – урду" lang="ur" hreflang="ur" data-title="جاوا اسکرپٹ" data-language-autonym="اردو" data-language-local-name="урду" class="interlanguage-link-target"><span>اردو</span></a></li><li class="interlanguage-link interwiki-uz mw-list-item"><a href="https://uz.wikipedia.org/wiki/JavaScript" title="JavaScript – узбекски" lang="uz" hreflang="uz" data-title="JavaScript" data-language-autonym="Oʻzbekcha / ўзбекча" data-language-local-name="узбекски" class="interlanguage-link-target"><span>Oʻzbekcha / ўзбекча</span></a></li><li class="interlanguage-link interwiki-vec mw-list-item"><a href="https://vec.wikipedia.org/wiki/JavaScript" title="JavaScript – Venetian" lang="vec" hreflang="vec" data-title="JavaScript" data-language-autonym="Vèneto" data-language-local-name="Venetian" class="interlanguage-link-target"><span>Vèneto</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/JavaScript" title="JavaScript – виетнамски" lang="vi" hreflang="vi" data-title="JavaScript" data-language-autonym="Tiếng Việt" data-language-local-name="виетнамски" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-wuu mw-list-item"><a href="https://wuu.wikipedia.org/wiki/JavaScript" title="JavaScript – ву китайски" lang="wuu" hreflang="wuu" data-title="JavaScript" data-language-autonym="吴语" data-language-local-name="ву китайски" class="interlanguage-link-target"><span>吴语</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/JavaScript" title="JavaScript – китайски" lang="zh" hreflang="zh" data-title="JavaScript" data-language-autonym="中文" data-language-local-name="китайски" class="interlanguage-link-target"><span>中文</span></a></li><li class="interlanguage-link interwiki-zh-classical mw-list-item"><a href="https://zh-classical.wikipedia.org/wiki/%E7%88%AA%E5%93%87%E6%89%8B%E7%A8%BF%E8%AA%9E" title="爪哇手稿語 – Literary Chinese" lang="lzh" hreflang="lzh" data-title="爪哇手稿語" data-language-autonym="文言" data-language-local-name="Literary Chinese" class="interlanguage-link-target"><span>文言</span></a></li><li class="interlanguage-link interwiki-zh-min-nan mw-list-item"><a href="https://zh-min-nan.wikipedia.org/wiki/JavaScript" title="JavaScript – Minnan" lang="nan" hreflang="nan" data-title="JavaScript" data-language-autonym="閩南語 / Bân-lâm-gú" data-language-local-name="Minnan" class="interlanguage-link-target"><span>閩南語 / Bân-lâm-gú</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/JavaScript" title="JavaScript – кантонски" lang="yue" hreflang="yue" data-title="JavaScript" data-language-autonym="粵語" data-language-local-name="кантонски" class="interlanguage-link-target"><span>粵語</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q2005#sitelinks-wikipedia" title="Редактиране на междуезиковите препратки" class="wbc-editpage">Редактиране</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Именни пространства"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/JavaScript" title="Преглед на основната страница [c]" accesskey="c"><span>Статия</span></a></li><li id="ca-talk" class="new vector-tab-noicon mw-list-item"><a href="/w/index.php?title=%D0%91%D0%B5%D1%81%D0%B5%D0%B4%D0%B0:JavaScript&action=edit&redlink=1" rel="discussion" class="new" title="Беседа за страницата (страницата не съществува) [t]" accesskey="t"><span>Беседа</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Промяна на езиковия вариант" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">български</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Прегледи"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/JavaScript"><span>Преглед</span></a></li><li id="ca-ve-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=JavaScript&veaction=edit" title="Редактиране на страницата [v]" accesskey="v"><span>Редактиране</span></a></li><li id="ca-edit" class="collapsible vector-tab-noicon mw-list-item"><a href="/w/index.php?title=JavaScript&action=edit" title="Редактиране на изходния код на страницата [e]" accesskey="e"><span>Редактиране на кода</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=JavaScript&action=history" title="Предишни версии на страницата [h]" accesskey="h"><span>История</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Инструменти" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Инструменти</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Инструменти</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">преместване към страничната лента</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">скриване</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="Допълнителни опции" > <div class="vector-menu-heading"> Действия </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/JavaScript"><span>Преглед</span></a></li><li id="ca-more-ve-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=JavaScript&veaction=edit" title="Редактиране на страницата [v]" accesskey="v"><span>Редактиране</span></a></li><li id="ca-more-edit" class="collapsible vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=JavaScript&action=edit" title="Редактиране на изходния код на страницата [e]" accesskey="e"><span>Редактиране на кода</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=JavaScript&action=history"><span>История</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> Основни </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%9A%D0%B0%D0%BA%D0%B2%D0%BE_%D1%81%D0%BE%D1%87%D0%B8_%D0%BD%D0%B0%D1%81%D0%B0%D0%BC/JavaScript" title="Списък на всички страници, сочещи насам [j]" accesskey="j"><span>Какво сочи насам</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A1%D0%B2%D1%8A%D1%80%D0%B7%D0%B0%D0%BD%D0%B8_%D0%BF%D1%80%D0%BE%D0%BC%D0%B5%D0%BD%D0%B8/JavaScript" rel="nofollow" title="Последните промени на страници, сочени от тази страница [k]" accesskey="k"><span>Свързани промени</span></a></li><li id="t-upload" class="mw-list-item"><a href="/wiki/MediaWiki:Uploadtext" title="Качи файлове [u]" accesskey="u"><span>Качване на файл</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B8" title="Списък на всички специални страници [q]" accesskey="q"><span>Специални страници</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=JavaScript&oldid=12238974" title="Постоянна препратка към тази версия на страницата"><span>Постоянна препратка</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=JavaScript&action=info" title="Повече за тази страница"><span>Информация за страницата</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%A6%D0%B8%D1%82%D0%B8%D1%80%D0%B0%D0%BD%D0%B5&page=JavaScript&id=12238974&wpFormIdentifier=titleform" title="Информация за начините за цитиране на тази страница"><span>Цитиране на статията</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:UrlShortener&url=https%3A%2F%2Fbg.wikipedia.org%2Fwiki%2FJavaScript"><span>Кратък URL адрес</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:QrCode&url=https%3A%2F%2Fbg.wikipedia.org%2Fwiki%2FJavaScript"><span>Изтегляне на QR код</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Отпечатване/изнасяне </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:Book&bookcmd=book_creator&referer=JavaScript"><span>Създаване на книга</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:DownloadAsPdf&page=JavaScript&action=show-download-screen"><span>Изтегляне като PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=JavaScript&printable=yes" title="Версия за печат на страницата [p]" accesskey="p"><span>Версия за печат</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> В други проекти </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="wb-otherproject-link wb-otherproject-commons mw-list-item"><a href="https://commons.wikimedia.org/wiki/Category:JavaScript" hreflang="en"><span>Общомедия</span></a></li><li class="wb-otherproject-link wb-otherproject-mediawiki mw-list-item"><a href="https://www.mediawiki.org/wiki/JavaScript" hreflang="en"><span>МедияУики</span></a></li><li class="wb-otherproject-link wb-otherproject-wikibooks mw-list-item"><a href="https://bg.wikibooks.org/wiki/JavaScript" hreflang="bg"><span>Уикикниги</span></a></li><li class="wb-otherproject-link wb-otherproject-wikifunctions mw-list-item"><a href="https://www.wikifunctions.org/wiki/Z600" hreflang="en"><span>Wikifunctions</span></a></li><li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q2005" title="Препратка към свързания обект от хранилището за данни [g]" accesskey="g"><span>Обект в Уикиданни</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Облик"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Облик</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">преместване към страничната лента</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">скриване</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">от Уикипедия, свободната енциклопедия</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="bg" dir="ltr"><table class="metadata plainlinks ambox ambox-content" role="presentation"><tbody><tr><td class="mbox-image"><div style="width:52px"><span typeof="mw:File"><a href="/wiki/%D0%A4%D0%B0%D0%B9%D0%BB:Crystal_kghostview.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Crystal_kghostview.png/40px-Crystal_kghostview.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Crystal_kghostview.png/60px-Crystal_kghostview.png 1.5x, //upload.wikimedia.org/wikipedia/commons/d/dd/Crystal_kghostview.png 2x" data-file-width="64" data-file-height="64" /></a></span></div></td><td class="mbox-text"><div class="mbox-text-span">Тази статия се нуждае от вниманието на <b>редактор с по-задълбочени познания</b>.<br />Ако смятате, че имате необходимите знания, <a class="external text" href="https://bg.wikipedia.org/w/index.php?title=JavaScript&action=edit"><b>подобрете</b></a> тази страница.<span class="hide-when-compact"></span><span class="hide-when-compact"></span></div></td></tr></tbody></table> <style data-mw-deduplicate="TemplateStyles:r12144718">.mw-parser-output .infobox-lua{width:22em}.mw-parser-output .infobox-title,.mw-parser-output .infobox-above,.mw-parser-output .infobox-subheader,.mw-parser-output .infobox-image,.mw-parser-output .infobox-header,.mw-parser-output .infobox-data-only,.mw-parser-output .infobox-below{text-align:center}.mw-parser-output .infobox-above{font-size:125%;font-weight:bold}.mw-parser-output .infobox-label,.mw-parser-output .infobox-data{text-align:left}.mw-parser-output .infobox-navbar{text-align:right}.mw-parser-output .infobox .navbar{font-size:100%}.mw-parser-output .infobox-italic-title{display:none}.mw-parser-output .infobox-subbox{padding:0;margin:-5px 0;border:0;border-spacing:0 5px;width:auto;min-width:100%;font-size:100%;clear:none;float:none;background-color:transparent}body.skin-minerva .mw-parser-output .infobox th.onlysubbox,body.skin-minerva .mw-parser-output .infobox td.onlysubbox{padding:0!important}</style><table class="infobox infobox-lua infobox_v2 vcard"><tbody><tr><td colspan="2" class="infobox-above title computer" style="background-color:#B0C4DE; border:1px solid #aaaaaa;">JavaScript</td></tr><tr><td colspan="2" class="infobox-image"><span typeof="mw:File"><a href="/wiki/%D0%A4%D0%B0%D0%B9%D0%BB:Unofficial_JavaScript_logo_2.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/140px-Unofficial_JavaScript_logo_2.svg.png" decoding="async" width="140" height="140" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/210px-Unofficial_JavaScript_logo_2.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/280px-Unofficial_JavaScript_logo_2.svg.png 2x" data-file-width="512" data-file-height="512" /></a></span><div>Неофициално лого JSConf EU 2011</div></td></tr><tr><th scope="row" class="infobox-label"><a href="/wiki/%D0%9F%D0%B0%D1%80%D0%B0%D0%B4%D0%B8%D0%B3%D0%BC%D0%B0_%D0%BD%D0%B0_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5" title="Парадигма на програмиране">Парадигма</a></th><td class="infobox-data"><a href="/wiki/%D0%9E%D0%B1%D0%B5%D0%BA%D1%82%D0%BD%D0%BE_%D0%BE%D1%80%D0%B8%D0%B5%D0%BD%D1%82%D0%B8%D1%80%D0%B0%D0%BD%D0%BE_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5" title="Обектно ориентирано програмиране">обектно ориентиран</a></td></tr><tr><th scope="row" class="infobox-label">Реализиране през</th><td class="infobox-data">1995</td></tr><tr><th scope="row" class="infobox-label">Автор</th><td class="infobox-data"><a href="/wiki/%D0%91%D1%80%D0%B5%D0%BD%D0%B4%D0%B0%D0%BD_%D0%90%D0%B9%D0%BA" title="Брендан Айк">Брендан Айк</a></td></tr><tr><th scope="row" class="infobox-label"><a href="/wiki/%D0%A2%D0%B8%D0%BF%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F_%D0%BD%D0%B0_%D0%B4%D0%B0%D0%BD%D0%BD%D0%B8%D1%82%D0%B5" title="Типизация на данните">Типизация на данните</a></th><td class="infobox-data">динамична</td></tr><tr><th scope="row" class="infobox-label">Повлиян от</th><td class="infobox-data"><a href="/wiki/Self" title="Self">Self</a>, <a href="/wiki/C_(%D0%B5%D0%B7%D0%B8%D0%BA_%D0%B7%D0%B0_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5)" title="C (език за програмиране)">C</a>, <a href="/wiki/Scheme" class="mw-redirect" title="Scheme">Scheme</a>, <a href="/wiki/Perl" class="mw-redirect" title="Perl">Perl</a>, <a href="/wiki/Python" title="Python">Python</a>, <a href="/wiki/Java" title="Java">Java</a></td></tr><tr><th scope="row" class="infobox-label">Повлиява</th><td class="infobox-data"><a href="/w/index.php?title=Objective-J&action=edit&redlink=1" class="new" title="Objective-J (страницата не съществува)">Objective-J</a></td></tr><tr><td colspan="2" class="infobox-below" style="background:#DCDCDC; border:1px solid #aaaaaa;"><b><a href="https://commons.wikimedia.org/wiki/Category:JavaScript" class="extiw" title="commons:Category:JavaScript">JavaScript</a></b> в <a href="/wiki/%D0%9E%D0%B1%D1%89%D0%BE%D0%BC%D0%B5%D0%B4%D0%B8%D1%8F" title="Общомедия">Общомедия</a></td></tr></tbody></table> <p><b>JavaScript</b> е интерпретируем <a href="/wiki/%D0%95%D0%B7%D0%B8%D0%BA_%D0%B7%D0%B0_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5" title="Език за програмиране">език за програмиране</a>, разпространяван с повечето <a href="/wiki/%D0%A3%D0%B5%D0%B1_%D0%B1%D1%80%D0%B0%D1%83%D0%B7%D1%8A%D1%80" class="mw-redirect" title="Уеб браузър">уеб браузъри</a>. Поддържа <a href="/wiki/%D0%9E%D0%B1%D0%B5%D0%BA%D1%82%D0%BD%D0%BE_%D0%BE%D1%80%D0%B8%D0%B5%D0%BD%D1%82%D0%B8%D1%80%D0%B0%D0%BD%D0%BE_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5" title="Обектно ориентирано програмиране">обектно ориентиран</a> и <a href="/wiki/%D0%A4%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%BE%D0%BD%D0%B0%D0%BB%D0%BD%D0%BE_%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5" title="Функционално програмиране">функционален</a> стил на програмиране. Създаден е в <a href="/w/index.php?title=Netscape&action=edit&redlink=1" class="new" title="Netscape (страницата не съществува)">Netscape</a> през 1995 г. Най-често се прилага към <a href="/wiki/HTML" title="HTML">HTML</a> кода на <a href="/wiki/%D0%98%D0%BD%D1%82%D0%B5%D1%80%D0%BD%D0%B5%D1%82_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0" class="mw-redirect" title="Интернет страница">интернет страница</a> с цел добавяне на функционалност и <a href="/wiki/AJAX" class="mw-redirect" title="AJAX">зареждане на данни</a>. Може да се ползва също за писане на сървърни скриптове <a href="/wiki/JSON" title="JSON">JSON</a>, както и за много други приложения. JavaScript не трябва да се бърка с <a href="/wiki/Java" title="Java">Java</a>, съвпадението на имената е резултат от маркетингово решение на Netscape. Javascript е стандартизиран под името EcmaScript. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="История"><span id=".D0.98.D1.81.D1.82.D0.BE.D1.80.D0.B8.D1.8F"></span>История</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=1" title="Редактиране на раздел: История" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=1" title="Edit section's source code: История"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>JavaScript е разработен първоначално от <a href="/wiki/%D0%91%D1%80%D0%B5%D0%BD%D0%B4%D0%B0%D0%BD_%D0%90%D0%B9%D0%BA" title="Брендан Айк">Брендан Айк</a> под името Mocha, като по-късно е преименуван на <a href="/wiki/LiveScript" class="mw-redirect" title="LiveScript">LiveScript</a> и накрая на JavaScript. LiveScript е официалното име на езика когато за първи път бива пуснат в бета версиите на Netscape Navigator 2.0 през септември 1995 г., но е преименуван на JavaScript на 4 декември 1995 г.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="Описание"><span id=".D0.9E.D0.BF.D0.B8.D1.81.D0.B0.D0.BD.D0.B8.D0.B5"></span>Описание</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=2" title="Редактиране на раздел: Описание" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=2" title="Edit section's source code: Описание"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>JavaScript е програмен език, който позволява динамична промяна на поведението на <a href="/wiki/%D0%91%D1%80%D0%B0%D1%83%D0%B7%D1%8A%D1%80" title="Браузър">браузъра</a> в рамките на дадена <a href="/wiki/HTML" title="HTML">HTML</a> страницата. JavaScript се зарежда, интерпретира и изпълнява от уеб браузъра, който му осигурява достъп до <a href="/wiki/DOM" class="mw-redirect" title="DOM">Обектния модел на браузъра</a>. JavaScript функции могат да се свържат със събития на страницата (например: движение/натискане на мишката, клавиатурата или елемент от страницата, и други потребителски действия). JavaScript е най-широко разпространеният език за програмиране в интернет. Прието е JavaScript програмите да се наричат <a href="/wiki/%D0%A1%D0%BA%D1%80%D0%B8%D0%BF%D1%82" title="Скрипт">скриптове</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Възможности"><span id=".D0.92.D1.8A.D0.B7.D0.BC.D0.BE.D0.B6.D0.BD.D0.BE.D1.81.D1.82.D0.B8"></span>Възможности</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=3" title="Редактиране на раздел: Възможности" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=3" title="Edit section's source code: Възможности"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>JavaScript може да влияе на почти всяка част от браузъра. Браузъра изпълнява JavaScript кода в <a href="/w/index.php?title=Event_loop&action=edit&redlink=1" class="new" title="Event loop (страницата не съществува)">цикъла на събития</a> т.е. като резултат от действия на потребителя или събития в браузъра (например document.onLoad). </p><p>Основни задачи в повечето JavaScript приложения са: </p> <ul><li>Зареждане на данни чрез <a href="/wiki/AJAX" class="mw-redirect" title="AJAX">AJAX</a>.</li> <li>Ефекти с изображения и <a href="/wiki/HTML" title="HTML">HTML</a> елементи: скриване/показване, пренареждане, влачене, слайд шоу, анимация и много други.</li> <li>Управление на прозорци и рамки.</li> <li>Разпознаване на възможностите на браузъра.</li> <li>Използване на камерата и микрофона.</li> <li>Създаване на 3D графики <a href="/wiki/WebGL" title="WebGL">WebGL</a>.</li> <li>По-добър и гъвкав <a href="/wiki/%D0%9F%D0%BE%D1%82%D1%80%D0%B5%D0%B1%D0%B8%D1%82%D0%B5%D0%BB%D1%81%D0%BA%D0%B8_%D0%B8%D0%BD%D1%82%D0%B5%D1%80%D1%84%D0%B5%D0%B9%D1%81" title="Потребителски интерфейс">потребителски интерфейс</a></li></ul> <p>Какво не може да се прави с помощта на JavaScript: </p> <ul><li>Не може да се записва информация на потребителския компютър или отдалечения сървър.</li> <li>Не може да се запазва информация директно в отдалечена база данни.</li> <li>Не може да се стартират локални приложения.</li></ul> <div class="mw-heading mw-heading3"><h3 id="Разлики_с_Java"><span id=".D0.A0.D0.B0.D0.B7.D0.BB.D0.B8.D0.BA.D0.B8_.D1.81_Java"></span>Разлики с Java</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=4" title="Редактиране на раздел: Разлики с Java" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=4" title="Edit section's source code: Разлики с Java"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Освен съвпадението в част от името, двата езика нямат кой знае какви прилики, дори са разработени от различни корпорации (Java е дело на <a href="/w/index.php?title=SUN&action=edit&redlink=1" class="new" title="SUN (страницата не съществува)">Sun</a>, a JavaScript е разработка на Netscape). Java е популярен език за програмиране не само на интернет приложения, но и на самостоятелни програми за различни платформи. Интернет приложенията на Java се наричат аплети. Те са файлове с разширение .class и се вмъкват в <a href="/wiki/HTML" title="HTML">HTML</a> документа между таговете <code><applet></code> и <code></applet></code>. </p> <div class="mw-heading mw-heading2"><h2 id="Основи_на_езика"><span id=".D0.9E.D1.81.D0.BD.D0.BE.D0.B2.D0.B8_.D0.BD.D0.B0_.D0.B5.D0.B7.D0.B8.D0.BA.D0.B0"></span>Основи на езика</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=5" title="Редактиране на раздел: Основи на езика" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=5" title="Edit section's source code: Основи на езика"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Зареждане"><span id=".D0.97.D0.B0.D1.80.D0.B5.D0.B6.D0.B4.D0.B0.D0.BD.D0.B5"></span>Зареждане</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=6" title="Редактиране на раздел: Зареждане" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=6" title="Edit section's source code: Зареждане"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>JavaScript кодът може да се вмъква в HTML документа между двойката елементи <script> и</script>. Когато срещне тага <script>, браузърът разбира, че трябва да спре интерпретирането на <a href="/wiki/HTML" title="HTML">HTML</a> кода и да започне да обработва скрипта, намиращ се между <script> и </script>. Този скрипт не е задължително да бъде написан на JavaScript. Има и други езици за писане на скриптове, например <a href="/w/index.php?title=VBScript&action=edit&redlink=1" class="new" title="VBScript (страницата не съществува)">VBScript</a>. Но езикът по подразбиране е JavaScript. В следния пример създаваме уеб страница в която е вмъкнат JavaScript код, който да изписва на екрана „Здравей!“ </p> <div class="mw-highlight mw-highlight-lang-html mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="cp"><!Doctype HTML></span> <span class="linenos" data-line="2"></span><span class="p"><</span><span class="nt">html</span><span class="p">></span> <span class="linenos" data-line="3"></span><span class="p"><</span><span class="nt">head</span><span class="p">></span> <span class="linenos" data-line="4"></span><span class="p"><</span><span class="nt">title</span><span class="p">></span>javascript<span class="p"></</span><span class="nt">title</span><span class="p">></span> <span class="linenos" data-line="5"></span><span class="p"></</span><span class="nt">head</span><span class="p">></span> <span class="linenos" data-line="6"></span><span class="p"><</span><span class="nt">body</span><span class="p">></span> <span class="linenos" data-line="7"></span><span class="p"><</span><span class="nt">script</span><span class="p">></span> <span class="linenos" data-line="8"></span><span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="s2">"Здравей!"</span><span class="p">);</span> <span class="linenos" data-line="9"></span><span class="p"></</span><span class="nt">script</span><span class="p">></span> <span class="linenos" data-line="10"></span><span class="p"></</span><span class="nt">body</span><span class="p">></span> <span class="linenos" data-line="11"></span><span class="p"></</span><span class="nt">html</span><span class="p">></span> </pre></div> <p>Препишете горния код в някой текстов редактор и запазете файла като hi.html. След това го отворете с някой браузър. </p><p>Другият начин да заредите JavaScript е да го поставите в отделен файл. В следващия пример отново ще напишем „Здравей“ на екрана, но ще заредим скрипта си от отделен файл. </p><p>Първо създаваме файла Hello.js: </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="s2">"Здравей!"</span><span class="p">);</span> </pre></div> <p>След което трябва да променим Hello.html от предходния пример по следния начин: </p> <div class="mw-highlight mw-highlight-lang-html mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="cm"><!--</span> <span class="linenos" data-line="2"></span><span class="cm"><script></span> <span class="linenos" data-line="3"></span><span class="cm"> document.write("Здравей!");</span> <span class="linenos" data-line="4"></span><span class="cm"></script></span> <span class="linenos" data-line="5"></span><span class="cm">--></span> <span class="linenos" data-line="6"></span> <span class="linenos" data-line="7"></span><span class="p"><</span><span class="nt">script</span> <span class="na">src</span><span class="o">=</span><span class="s">"Hello.js"</span><span class="p">></</span><span class="nt">script</span><span class="p">></span> </pre></div> <p>Това разделение на javascript логиката от HTML структурата е един от основните принципи на <a href="/wiki/%D0%A1%D0%BE%D1%84%D1%82%D1%83%D0%B5%D1%80%D0%BD%D0%BE_%D0%B8%D0%BD%D0%B6%D0%B5%D0%BD%D0%B5%D1%80%D1%81%D1%82%D0%B2%D0%BE" title="Софтуерно инженерство">Софтуерното инженерство</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Променливи"><span id=".D0.9F.D1.80.D0.BE.D0.BC.D0.B5.D0.BD.D0.BB.D0.B8.D0.B2.D0.B8"></span>Променливи</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=7" title="Редактиране на раздел: Променливи" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=7" title="Edit section's source code: Променливи"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p><a href="/wiki/%D0%9F%D1%80%D0%BE%D0%BC%D0%B5%D0%BD%D0%BB%D0%B8%D0%B2%D0%B0_(%D0%BF%D1%80%D0%BE%D0%B3%D1%80%D0%B0%D0%BC%D0%B8%D1%80%D0%B0%D0%BD%D0%B5)" title="Променлива (програмиране)">Променливите</a> в JavaScript са динамични и могат да съдържат стойности от всеки тип. Декларират се чрез ключовата дума <code>var</code> следвана от името на променливата или списък от променливи. Възможно е също да присвоите стойност на променливата при декларация чрез оператора =. По подразбиране стойността на променливата ще бъде <code>undefined</code>. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">greeting</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"Здравей!"</span><span class="p">,</span><span class="w"> </span><span class="nx">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">42</span><span class="p">;</span> <span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">greeting</span><span class="p">);</span> </pre></div> <p>Тук имаме списък от променливи. Името на първата е greeting, а стойността ѝ е „Здравей!“. Когато отпечатваме променливата greeting ние всъщност отпечатваме стойността ѝ „Здравей!“. </p> <div class="mw-heading mw-heading4"><h4 id="Имена_на_променливи"><span id=".D0.98.D0.BC.D0.B5.D0.BD.D0.B0_.D0.BD.D0.B0_.D0.BF.D1.80.D0.BE.D0.BC.D0.B5.D0.BD.D0.BB.D0.B8.D0.B2.D0.B8"></span>Имена на променливи</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=8" title="Редактиране на раздел: Имена на променливи" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=8" title="Edit section's source code: Имена на променливи"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Имената на променливите в JavaScript не трябва да започват с цифра, могат да започват с малка или голяма буква, _ или $ и да съдържат само тези знаци както и числа. Всички останали символи са забранени. Името на променливата не може да е ключова дума или оператор. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">//Валидни имена на променливи:</span> <span class="kd">var</span><span class="w"> </span><span class="nx">ninja</span><span class="p">,</span><span class="w"> </span><span class="nx">apples_and_oranges</span><span class="p">,</span><span class="w"> </span><span class="nx">var56</span><span class="p">,</span><span class="w"> </span><span class="nx">$</span><span class="p">,</span><span class="w"> </span><span class="nx">nutsAndBolts</span><span class="p">;</span> <span class="c1">//Невалидни имена на променливи:</span> <span class="kd">var</span><span class="w"> </span><span class="mf">3</span><span class="p">,</span><span class="w"> </span><span class="kd">var</span><span class="p">,</span><span class="w"> </span><span class="s2">"test"</span><span class="p">,</span><span class="w"> </span><span class="k">if</span><span class="p">,</span><span class="w"> </span><span class="k">while</span><span class="p">,</span><span class="w"> </span><span class="mf">5</span><span class="nx">wtx1</span><span class="p">;</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="Обхват_на_променливите"><span id=".D0.9E.D0.B1.D1.85.D0.B2.D0.B0.D1.82_.D0.BD.D0.B0_.D0.BF.D1.80.D0.BE.D0.BC.D0.B5.D0.BD.D0.BB.D0.B8.D0.B2.D0.B8.D1.82.D0.B5"></span>Обхват на променливите</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=9" title="Редактиране на раздел: Обхват на променливите" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=9" title="Edit section's source code: Обхват на променливите"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>В JavaScript има два вида обхват за променливите: функционален и глобален. </p> <ul><li>Функционален обхват важи за всяка променлива обявена чрез <code>var</code> в рамките на дадена функция. Тази променлива е видима единствено в рамките на тази функция.</li> <li>Глобален обхват важи за всяка променлива обявена извън функция или без <code>var</code>, дори и във функция. Тази променлива е видима от всеки друг код на страницата.</li></ul> <div class="mw-heading mw-heading4"><h4 id="Константи"><span id=".D0.9A.D0.BE.D0.BD.D1.81.D1.82.D0.B0.D0.BD.D1.82.D0.B8"></span>Константи</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=10" title="Редактиране на раздел: Константи" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=10" title="Edit section's source code: Константи"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>От версия ES6 на ECMAScript е възможно декларирането на константи с ключовата дума const. В миналите версии на езика даден обект може да се замрази <code>object.freeze(myConstants);</code> което спира промяната на стойностите на членовете му. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">//Деклариране на константа с числото Пи:</span> <span class="kd">const</span><span class="w"> </span><span class="nx">PI</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">3.141592653589793</span><span class="p">;</span> <span class="c1">//Използване на константата при инициализация на друга променлива</span> <span class="kd">var</span><span class="w"> </span><span class="nx">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">PI</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="mf">2</span><span class="p">;</span> <span class="c1">//Ще върне грешка "TypeError", защото константите не могат да бъдат променяни</span> <span class="nx">PI</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">3.14</span><span class="p">;</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Прости_типове_данни"><span id=".D0.9F.D1.80.D0.BE.D1.81.D1.82.D0.B8_.D1.82.D0.B8.D0.BF.D0.BE.D0.B2.D0.B5_.D0.B4.D0.B0.D0.BD.D0.BD.D0.B8"></span>Прости типове данни</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=11" title="Редактиране на раздел: Прости типове данни" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=11" title="Edit section's source code: Прости типове данни"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>В JavaScript има няколко основни прости типа данни: </p> <ul><li>Числа – всички числа в JavaScript са представени по един и същи начин в паметта. Няма отделна категории за целочислени и дробни.</li> <li>Низове – низовете се ограждат с единични или двойни кавички и могат да съдържат всеки друг знак.</li> <li>Булеви – само две стойности: true и false.</li></ul> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">//Инициализиране на числова променлива:</span> <span class="kd">var</span><span class="w"> </span><span class="nx">a</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">3</span><span class="p">;</span> <span class="c1">//Инициализиране на променлива с низ</span> <span class="kd">var</span><span class="w"> </span><span class="nx">b</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"JavaScript iz kuwl"</span><span class="p">;</span> <span class="c1">//Инициализиране на булева променлива</span> <span class="kd">var</span><span class="w"> </span><span class="nx">c</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">true</span><span class="p">;</span> <span class="c1">//Извеждане на типа на данните в променливите</span> <span class="nx">alert</span><span class="p">(</span><span class="ow">typeof</span><span class="w"> </span><span class="nx">a</span><span class="p">);</span> <span class="nx">alert</span><span class="p">(</span><span class="ow">typeof</span><span class="w"> </span><span class="nx">b</span><span class="p">);</span> <span class="nx">alert</span><span class="p">(</span><span class="ow">typeof</span><span class="w"> </span><span class="nx">c</span><span class="p">);</span> </pre></div> <p>Този пример създава променливи с начална стойност от три различни типа данни, поддържани от JavaScript. Първо използваме ключовата дума typeof, за да върне типовете данни и след това ги подаваме като параметри на функцията alert за да бъдат показани в диалогов прозорец. </p> <div class="mw-heading mw-heading3"><h3 id="Оператори"><span id=".D0.9E.D0.BF.D0.B5.D1.80.D0.B0.D1.82.D0.BE.D1.80.D0.B8"></span>Оператори</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=12" title="Редактиране на раздел: Оператори" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=12" title="Edit section's source code: Оператори"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Езикът JavaScript притежава два вида оператори, с един или два аргумента. Единичните (едноаргументни) оператори променят стойността на дадена променлива или израз в скоби, докато двойните (двуаргументни) оператори връщат нова стойност като резултат. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">sum</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">5</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mf">7</span><span class="p">;</span><span class="w"> </span><span class="c1">//sum става 12</span> <span class="kd">var</span><span class="w"> </span><span class="nx">negative</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">-</span><span class="mf">9</span><span class="p">;</span><span class="w"> </span><span class="c1">//отрицателният знак може да е и едно- и двуаргументен</span> <span class="kd">var</span><span class="w"> </span><span class="nx">subtraction</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">12</span><span class="w"> </span><span class="err">–</span><span class="w"> </span><span class="mf">7</span><span class="p">;</span><span class="w"> </span><span class="c1">//subtraction става 5</span> </pre></div> <table class="wikitable"> <tbody><tr> <th>Сравнителен оператор</th> <th>Действие </th></tr> <tr> <td>==</td> <td>Равенство, не се препоръчва </td></tr> <tr> <td>!=</td> <td>Неравенство, не се препоръчва </td></tr> <tr> <td>===</td> <td>Стриктно равенство </td></tr> <tr> <td>!==</td> <td>Стриктно неравенство </td></tr> <tr> <td><</td> <td>По-малко </td></tr> <tr> <td>></td> <td>По-голямо </td></tr> <tr> <td><=</td> <td>По-малко или равно </td></tr> <tr> <td>>=</td> <td>По-голямо или равно </td></tr> <tr> <td> </td> <td> </td></tr></tbody></table> <p>Стриктното равенство/неравенство проверява стойността или типа на променливите. </p><p>Равенството/неравенството проверява само стойността и не се препоръчва защото ако се провери „1“ и 1 това е вярно, но „1“ е низ а 1 е число!!! </p> <table class="wikitable"> <tbody><tr> <th>Аритметичен оператор</th> <th>Действие </th></tr> <tr> <td>+</td> <td>Събиране </td></tr> <tr> <td>–</td> <td>Изваждане </td></tr> <tr> <td>*</td> <td>Умножение </td></tr> <tr> <td>/</td> <td>Деление (без остатък) </td></tr> <tr> <td>%</td> <td>Деление (с остатък) </td></tr></tbody></table> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="kd">var</span><span class="w"> </span><span class="nx">five</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">5</span><span class="p">,</span> <span class="w"> </span><span class="nx">seven</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">7</span><span class="p">,</span> <span class="w"> </span><span class="nx">greeting</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s2">"Здравей!"</span><span class="p">;</span> <span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">five</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">seven</span><span class="p">);</span><span class="w"> </span><span class="c1">//изписва сбора на five и seven т.е. 12</span> <span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="s2">"<br />"</span><span class="p">);</span><span class="w"> </span><span class="c1">//добавя HTML тага за нов ред</span> <span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="nx">greeting</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">five</span><span class="p">);</span><span class="w"> </span><span class="c1">//изписва "Здравей!5"</span> </pre></div> <p>Забележете че резултата от събирането на greeting и five е „Здравей!5“. Когато стойността на едната или двете променливи не е число, резултатът е стойностите „слепени“ в нов низ. </p> <table class="wikitable"> <tbody><tr> <th>Логически оператор</th> <th>Действие </th></tr> <tr> <td>!</td> <td>(логическо отрицание) </td></tr> <tr> <td>&&</td> <td>И (логическо умножение) </td></tr> <tr> <td>||</td> <td>Или (логическо събиране) </td></tr></tbody></table> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="c1">//при присвояване на стойност могат да се използват оператори</span> <span class="linenos" data-line="2"></span><span class="c1">//например:</span> <span class="linenos" data-line="3"></span><span class="kd">var</span><span class="w"> </span><span class="nx">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">5</span><span class="p">;</span> <span class="linenos" data-line="4"></span><span class="nx">x</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">x</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mf">5</span><span class="p">;</span><span class="w"> </span><span class="c1">// x става 10</span> <span class="linenos" data-line="5"></span><span class="nx">x</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="mf">5</span><span class="p">;</span><span class="w"> </span><span class="c1">// също добавя 5 към x</span> <span class="linenos" data-line="6"></span> <span class="linenos" data-line="7"></span><span class="kd">var</span><span class="w"> </span><span class="nx">y</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">12</span><span class="p">;</span> <span class="linenos" data-line="8"></span><span class="nx">y</span><span class="w"> </span><span class="o">-=</span><span class="w"> </span><span class="mf">1</span><span class="p">;</span><span class="w"> </span><span class="c1">// y става 11</span> <span class="linenos" data-line="9"></span><span class="nx">y</span><span class="w"> </span><span class="o">*=</span><span class="w"> </span><span class="mf">2</span><span class="p">;</span><span class="w"> </span><span class="c1">// y става 24</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Сложни_типове_данни"><span id=".D0.A1.D0.BB.D0.BE.D0.B6.D0.BD.D0.B8_.D1.82.D0.B8.D0.BF.D0.BE.D0.B2.D0.B5_.D0.B4.D0.B0.D0.BD.D0.BD.D0.B8"></span>Сложни типове данни</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=13" title="Редактиране на раздел: Сложни типове данни" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=13" title="Edit section's source code: Сложни типове данни"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Абстрактните типове данни в JavaScript са полезни. Те включват масиви, функции и обекти. </p> <div class="mw-heading mw-heading4"><h4 id="Масиви"><span id=".D0.9C.D0.B0.D1.81.D0.B8.D0.B2.D0.B8"></span>Масиви</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=14" title="Редактиране на раздел: Масиви" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=14" title="Edit section's source code: Масиви"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Масивите съдържат списък от елементи и се бележат с []. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr" dir="ltr"><pre><span></span><span class="c1">// създаване на нов масив:</span> <span class="kd">var</span><span class="w"> </span><span class="nx">empty</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[];</span><span class="w"> </span><span class="c1">// празен масив</span> <span class="kd">var</span><span class="w"> </span><span class="nx">my_data</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mf">1</span><span class="p">,</span><span class="w"> </span><span class="mf">2</span><span class="p">,</span><span class="w"> </span><span class="mf">3</span><span class="p">,</span><span class="w"> </span><span class="s2">"Hi!"</span><span class="p">,</span><span class="w"> </span><span class="s2">"Bye!"</span><span class="p">,</span><span class="w"> </span><span class="o">-</span><span class="mf">2.11</span><span class="w"> </span><span class="p">];</span> <span class="kd">var</span><span class="w"> </span><span class="nx">array_of_arrays</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[[</span><span class="mf">1</span><span class="p">,</span><span class="w"> </span><span class="mf">2</span><span class="p">,</span><span class="w"> </span><span class="mf">3</span><span class="p">],</span><span class="w"> </span><span class="p">[</span><span class="mf">4</span><span class="p">,</span><span class="w"> </span><span class="mf">5</span><span class="p">,</span><span class="w"> </span><span class="mf">6</span><span class="p">],</span><span class="w"> </span><span class="s2">"Anything else?"</span><span class="p">];</span><span class="w"> </span><span class="c1">// масив от масиви</span> </pre></div> <p>Тъй като JavaScript е динамичен език, елементите от масива могат да са от различен тип. Един масив може да съдържа други масиви, обекти и функции. </p> <div class="mw-heading mw-heading4"><h4 id="Функции"><span id=".D0.A4.D1.83.D0.BD.D0.BA.D1.86.D0.B8.D0.B8"></span>Функции</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=15" title="Редактиране на раздел: Функции" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=15" title="Edit section's source code: Функции"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Функциите съдържат код, който ще бъде изпълнен когато функцията бъде извикана. Функцията винаги връща стойност, а ако в края няма return функцията връща undefined. Функциите могат да приемат параметри (аргументи) и да връщат резултат от всякакъв вид: число, текст, обект, масив или друга функция. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="c1">// декларация на функция "Кажи "Здравей!" с параметър "име"; връща текста "Здравей, _име_ !"</span> <span class="linenos" data-line="2"></span><span class="kd">function</span><span class="w"> </span><span class="nx">SayHello</span><span class="p">(</span><span class="nx">name</span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="linenos" data-line="3"></span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s2">"Здравей, "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">name</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"!"</span><span class="p">;</span> <span class="linenos" data-line="4"></span><span class="p">}</span> <span class="linenos" data-line="5"></span> <span class="linenos" data-line="6"></span><span class="c1">// този запис е еквивалентен на горния запис:</span> <span class="linenos" data-line="7"></span><span class="kd">var</span><span class="w"> </span><span class="nx">SayHello</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kd">function</span><span class="p">(</span><span class="nx">name</span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="linenos" data-line="8"></span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s2">"Здравей, "</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nx">name</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="s2">"!"</span><span class="p">;</span> <span class="linenos" data-line="9"></span><span class="p">};</span> <span class="linenos" data-line="10"></span> <span class="linenos" data-line="11"></span><span class="c1">// извикване на функцията "Кажи "Здравей!"</span> <span class="linenos" data-line="12"></span><span class="nx">SayHello</span><span class="p">(</span><span class="s2">"Иван"</span><span class="p">);</span><span class="w"> </span><span class="c1">// Здравей, Иван!</span> </pre></div> <p>Функциите са много гъвкави структури и са едно от най-добрите неща в JavaScript. Позволяват за <a href="/wiki/%D0%97%D0%B0%D1%82%D0%B2%D0%B0%D1%80%D1%8F%D0%BD%D0%B5_(%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%82%D0%B8%D0%BA%D0%B0)" title="Затваряне (информатика)">логическо затваряне</a> и <a href="/w/index.php?title=Scope_(computer_science)&action=edit&redlink=1" class="new" title="Scope (computer science) (страницата не съществува)">обособен обхват на променливите</a>. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="c1">// създаване на нова функция, която връща функция, която връща името на зададеното като параметър число:</span> <span class="linenos" data-line="2"></span><span class="c1">// външната функция се изпълнява веднага след като е дефинирана</span> <span class="linenos" data-line="3"></span><span class="kd">var</span><span class="w"> </span><span class="nx">numberName</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">(</span><span class="kd">function</span><span class="p">()</span><span class="w"> </span><span class="p">{</span> <span class="linenos" data-line="4"></span><span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">names</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="s2">"нула"</span><span class="p">,</span><span class="w"> </span><span class="s2">"едно"</span><span class="p">,</span><span class="w"> </span><span class="s2">"две"</span><span class="p">,</span><span class="w"> </span><span class="s2">"три"</span><span class="p">,</span><span class="w"> </span><span class="s2">"четири"</span><span class="p">,</span><span class="w"> </span><span class="s2">"пет"</span><span class="p">,</span><span class="w"> </span><span class="s2">"шест"</span><span class="p">,</span><span class="w"> </span><span class="s2">"седем"</span><span class="p">,</span><span class="w"> </span><span class="s2">"осем"</span><span class="p">,</span><span class="w"> </span><span class="s2">"девет"</span><span class="p">,</span><span class="w"> </span><span class="s2">"десет"</span><span class="p">];</span> <span class="linenos" data-line="5"></span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="kd">function</span><span class="p">(</span><span class="nx">n</span><span class="p">)</span><span class="w"> </span><span class="p">{</span> <span class="linenos" data-line="6"></span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="nx">names</span><span class="p">[</span><span class="nx">n</span><span class="p">];</span> <span class="linenos" data-line="7"></span><span class="w"> </span><span class="p">};</span> <span class="linenos" data-line="8"></span><span class="p">}());</span> <span class="linenos" data-line="9"></span> <span class="linenos" data-line="10"></span><span class="nx">numberName</span><span class="p">(</span><span class="mf">6</span><span class="p">);</span><span class="w"> </span><span class="c1">// връща "шест"</span> </pre></div> <div class="mw-heading mw-heading4"><h4 id="Обекти"><span id=".D0.9E.D0.B1.D0.B5.D0.BA.D1.82.D0.B8"></span>Обекти</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=16" title="Редактиране на раздел: Обекти" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=16" title="Edit section's source code: Обекти"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Обектите съдържат свойства и методи. Те са съвкупност от данни и функции, които работят за изпълнението на свързана задача, бележат се с {}. </p> <div class="mw-highlight mw-highlight-lang-javascript mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="c1">// създаване на нов обект "студент" със свойства име, оценка и функция за дрямка:</span> <span class="linenos" data-line="2"></span><span class="kd">var</span><span class="w"> </span><span class="nx">student</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span> <span class="linenos" data-line="3"></span><span class="w"> </span><span class="nx">name</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="s2">"Иван"</span><span class="p">,</span> <span class="linenos" data-line="4"></span><span class="w"> </span><span class="nx">grade</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="mf">4.50</span><span class="p">,</span> <span class="linenos" data-line="5"></span><span class="w"> </span><span class="nx">nap</span><span class="w"> </span><span class="o">:</span><span class="w"> </span><span class="kd">function</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">this</span><span class="p">.</span><span class="nx">grade</span><span class="w"> </span><span class="o">-=</span><span class="w"> </span><span class="mf">0.5</span><span class="p">;</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="s2">"ZzZ"</span><span class="p">;</span><span class="w"> </span><span class="p">}</span> <span class="linenos" data-line="6"></span><span class="p">};</span> <span class="linenos" data-line="7"></span> <span class="linenos" data-line="8"></span><span class="c1">// прилагане на метода на студента за дрямка и извеждане на оценката</span> <span class="linenos" data-line="9"></span><span class="nx">student</span><span class="p">.</span><span class="nx">nap</span><span class="p">();</span> <span class="linenos" data-line="10"></span><span class="nx">alert</span><span class="p">(</span><span class="nx">student</span><span class="p">.</span><span class="nx">grade</span><span class="p">);</span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="Чести_грешки_при_програмиране_с_JavaScript"><span id=".D0.A7.D0.B5.D1.81.D1.82.D0.B8_.D0.B3.D1.80.D0.B5.D1.88.D0.BA.D0.B8_.D0.BF.D1.80.D0.B8_.D0.BF.D1.80.D0.BE.D0.B3.D1.80.D0.B0.D0.BC.D0.B8.D1.80.D0.B0.D0.BD.D0.B5_.D1.81_JavaScript"></span>Чести грешки при програмиране с JavaScript</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=17" title="Редактиране на раздел: Чести грешки при програмиране с JavaScript" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=17" title="Edit section's source code: Чести грешки при програмиране с JavaScript"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Много пъти ще видите JavaScript кода обвит в HTML коментар. Към 2013 г. тази практика е излишна. Някои по-стари браузъри, които вече не са в употреба, не разбират JavaScript. Затова трябва да скривате скрипта в <a href="/wiki/HTML" title="HTML">HTML</a> коментари. Така по-старите версии на браузърите ще помислят JavaScript кода за коментар и няма да съобщят за грешка. </p><p>Ето как ще изглежда скрипт заграден с коментари: Не го правете освен ако не искате да поддържате много стари браузъри!!! </p> <div class="mw-highlight mw-highlight-lang-html mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="p"><</span><span class="nt">script</span><span class="p">></span> <span class="linenos" data-line="2"></span><span class="w"> </span><span class="c"><!--</span> <span class="linenos" data-line="3"></span><span class="w"> </span><span class="nb">document</span><span class="p">.</span><span class="nx">write</span><span class="p">(</span><span class="s2">"Здравей!"</span><span class="p">)</span> <span class="linenos" data-line="4"></span><span class="w"> </span><span class="c1">//--></span> <span class="linenos" data-line="5"></span><span class="p"></</span><span class="nt">script</span><span class="p">></span> </pre></div> <p>Функцията document.write не се препоръчва, защото може да има неочаквани резултати (подмяна на съдържането). В следващия пример използваме един от чистите начини да вмъкнем <a href="/wiki/HTML" title="HTML">HTML</a> таг: </p> <div class="mw-highlight mw-highlight-lang-html mw-content-ltr mw-highlight-lines" dir="ltr"><pre><span></span><span class="linenos" data-line="1"></span><span class="p"><</span><span class="nt">script</span><span class="p">></span> <span class="linenos" data-line="2"></span><span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">innerHTML</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="s2">"<h1>Здравей!</h1>"</span><span class="p">;</span> <span class="linenos" data-line="3"></span><span class="p"></</span><span class="nt">script</span><span class="p">></span> </pre></div> <div class="mw-heading mw-heading2"><h2 id="Източници"><span id=".D0.98.D0.B7.D1.82.D0.BE.D1.87.D0.BD.D0.B8.D1.86.D0.B8"></span>Източници</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=18" title="Редактиране на раздел: Източници" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=18" title="Edit section's source code: Източници"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><cite id="CITEREFWeb_Education_Community_Group_Wiki" class="book" style="font-style:normal"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20130725083909/http://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript">A Short History of JavaScript</a> //   Web Education Community Group Wiki.  Архивиран от <a rel="nofollow" class="external text" href="http://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript">оригинала</a> на 2013-07-25. Посетен на 16 юли 2013.<span class="cite-lang"> <small style="color: var(--color-subtle, #54595d);">(на английски)</small></span></cite></span> </li> </ol></div> <div class="mw-heading mw-heading2"><h2 id="Вижте_също"><span id=".D0.92.D0.B8.D0.B6.D1.82.D0.B5_.D1.81.D1.8A.D1.89.D0.BE"></span>Вижте също</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=JavaScript&veaction=edit&section=19" title="Редактиране на раздел: Вижте също" class="mw-editsection-visualeditor"><span>редактиране</span></a><span class="mw-editsection-divider"> | </span><a href="/w/index.php?title=JavaScript&action=edit&section=19" title="Edit section's source code: Вижте също"><span>редактиране на кода</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Ajax" class="mw-redirect" title="Ajax">Ajax</a></li> <li><a href="/w/index.php?title=JScript&action=edit&redlink=1" class="new" title="JScript (страницата не съществува)">JScript</a></li> <li><a href="/wiki/ECMAScript" title="ECMAScript">ECMAScript</a></li> <li><a href="/wiki/DOM" class="mw-redirect" title="DOM">DOM</a></li> <li><a href="/w/index.php?title=XUL&action=edit&redlink=1" class="new" title="XUL (страницата не съществува)">XUL</a></li></ul> <!-- NewPP limit report Parsed by mw‐web.eqiad.main‐7696bb7cb8‐sh8s5 Cached time: 20241029135359 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.135 seconds Real time usage: 0.200 seconds Preprocessor visited node count: 789/1000000 Post‐expand include size: 10381/2097152 bytes Template argument size: 2460/2097152 bytes Highest expansion depth: 16/100 Expensive parser function count: 16/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 26921/5000000 bytes Lua time usage: 0.035/10.000 seconds Lua memory usage: 1275849/52428800 bytes Number of Wikibase entities loaded: 1/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 146.359 1 -total 37.29% 54.580 1 Шаблон:Програмен_език 35.26% 51.606 1 Шаблон:Infobox 30.96% 45.316 1 Шаблон:Експерт 28.97% 42.398 1 Шаблон:Ambox 25.43% 37.216 1 Шаблон:Cite_web 23.33% 34.144 1 Шаблон:Cite 16.20% 23.708 1 Шаблон:Източник_БДС_17377 6.22% 9.109 1 Шаблон:Cite-lang 3.66% 5.357 1 Шаблон:Delink --> <!-- Saved in parser cache with key bgwiki:pcache:idhash:63292-0!canonical and timestamp 20241029135359 and revision id 12238974. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Взето от „<a dir="ltr" href="https://bg.wikipedia.org/w/index.php?title=JavaScript&oldid=12238974">https://bg.wikipedia.org/w/index.php?title=JavaScript&oldid=12238974</a>“.</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/%D0%A1%D0%BF%D0%B5%D1%86%D0%B8%D0%B0%D0%BB%D0%BD%D0%B8:%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D0%B8" title="Специални:Категории">Категории</a>: <ul><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:JavaScript" title="Категория:JavaScript">JavaScript</a></li><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:%D0%98%D0%B7%D0%BE%D0%B1%D1%80%D0%B5%D1%82%D0%B5%D0%BD%D0%B8%D1%8F_%D0%B2_%D0%A1%D0%90%D0%A9" title="Категория:Изобретения в САЩ">Изобретения в САЩ</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Скрита категория: <ul><li><a href="/wiki/%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:%D0%A1%D1%82%D0%B0%D1%82%D0%B8%D0%B8_%D0%B7%D0%B0_%D1%80%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%B8%D1%80%D0%B0%D0%BD%D0%B5" title="Категория:Статии за редактиране">Статии за редактиране</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> Последната промяна на страницата е извършена на 17 май 2024 г. в 20:24 ч.</li> <li id="footer-info-copyright">Текстът е достъпен под лиценза <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.bg">Creative Commons Признание-Споделяне на споделеното</a>; може да са приложени допълнителни условия. За подробности вижте <a class="external text" href="https://foundation.wikimedia.org/wiki/Policy:Terms_of_Use/bg">Условия за ползване</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Поверителност</a></li> <li id="footer-places-about"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%97%D0%B0_%D0%BA%D0%BE%D0%BD%D1%82%D0%B0%D0%BA%D1%82%D0%B8">За контакт с Уикипедия</a></li> <li id="footer-places-disclaimers"><a href="/wiki/%D0%A3%D0%B8%D0%BA%D0%B8%D0%BF%D0%B5%D0%B4%D0%B8%D1%8F:%D0%9F%D1%80%D0%B5%D0%B4%D1%83%D0%BF%D1%80%D0%B5%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B5">Предупреждение</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Кодекс на поведение</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">За разработчици</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/bg.wikipedia.org">Статистика</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Използване на „бисквитки“</a></li> <li id="footer-places-mobileview"><a href="//bg.m.wikipedia.org/w/index.php?title=JavaScript&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Мобилен изглед</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-669b4ddb54-gqnxr","wgBackendResponseTime":176,"wgPageParseReport":{"limitreport":{"cputime":"0.135","walltime":"0.200","ppvisitednodes":{"value":789,"limit":1000000},"postexpandincludesize":{"value":10381,"limit":2097152},"templateargumentsize":{"value":2460,"limit":2097152},"expansiondepth":{"value":16,"limit":100},"expensivefunctioncount":{"value":16,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":26921,"limit":5000000},"entityaccesscount":{"value":1,"limit":400},"timingprofile":["100.00% 146.359 1 -total"," 37.29% 54.580 1 Шаблон:Програмен_език"," 35.26% 51.606 1 Шаблон:Infobox"," 30.96% 45.316 1 Шаблон:Експерт"," 28.97% 42.398 1 Шаблон:Ambox"," 25.43% 37.216 1 Шаблон:Cite_web"," 23.33% 34.144 1 Шаблон:Cite"," 16.20% 23.708 1 Шаблон:Източник_БДС_17377"," 6.22% 9.109 1 Шаблон:Cite-lang"," 3.66% 5.357 1 Шаблон:Delink"]},"scribunto":{"limitreport-timeusage":{"value":"0.035","limit":"10.000"},"limitreport-memusage":{"value":1275849,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-7696bb7cb8-sh8s5","timestamp":"20241029135359","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"JavaScript","url":"https:\/\/bg.wikipedia.org\/wiki\/JavaScript","sameAs":"http:\/\/www.wikidata.org\/entity\/Q2005","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q2005","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"\u0424\u043e\u043d\u0434\u0430\u0446\u0438\u044f \u0423\u0438\u043a\u0438\u043c\u0435\u0434\u0438\u044f","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2005-10-07T10:38:34Z","dateModified":"2024-05-17T20:24:22Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/9\/99\/Unofficial_JavaScript_logo_2.svg","headline":"\u0435\u0437\u0438\u043a \u0437\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u0438\u0440\u0430\u043d\u0435"}</script> </body> </html>