JavaScript: Versiyalar orasidagi farq

Bot v1: Tuzatmalar (xato haqida xabar berish)
k (Bot v1: Umumiy tuzatmalar (xato haqida xabar berish))
(Bot v1: Tuzatmalar (xato haqida xabar berish))
| nomi = JavaScript
| tasvir = [[Fayl:Unofficial_JavaScript_logo_2.svg|center|150px]]
| introduced = {{start date and age|1995|12|4}}<ref name="press_release">[https://web.archive.org/web/20070916144913/http://wp.netscape.com/newsref/pr/newsrelease67.html Press release announcing JavaScript], „Netscape and Sun announce JavaScript“, PR Newswire, December 4,-dekabr 1995-yil</ref>
| turi =
| maqomi =
| registry = {{plainlist|
* <code>.js</code>
* <code>.mjs</code><ref name="node.js ECMAScript Modules Specification">{{citeWeb webmanbasi|url=https://github.com/nodejs/node-eps/blob/master/002-es-modules.md|title=nodejs/node-eps|website=GitHub}}</ref>
}}
| versiyalari =
| vebsayt =
| platforma =
}}'''Javascript'''<ref>{{citeWeb webmanbasi | url= http://dictionary.reference.com/browse/javascript | title= JavaScript | publisher= William Collins Sons & Co | work= Collins English Dictionary – Complete & Unabridged 2012 Digital Edition | date= 2012 | accessdate= 21 August-avgust 2015-yil}}</ref> — '''JS''' nomi bilan ham qisqartiriladigan [[ECMAScript]] spesifikatsiyasiga mos keladigan yuqori darajali hamda aniq talqin qilingan [[Dastur|dasturlash tili]].<ref name=tc39>{{CiteWeb webmanbasi|url=https://tc39.es/ecma262/#sec-overview|title=ECMAScript® 2020 Language Specification}}</ref><ref>{{citeWeb webmanbasi | url= http://dictionary.reference.com/browse/javascript | title= JavaScript | publisher= William Collins Sons & Co | work= Collins English Dictionary – Complete & Unabridged 2012 Digital Edition | date= 2012 | accessdate= 21-avgust 2015}}</ref>
 
== Imkoniyatlari ==
 
JavaScript dasturlash tili sintaktik jihatdan Java dasturlash tiliga, jismli modellashni istisno qilgan holda, oʻxshab ketsada, lekin maʼlumotlarni statik turlari va qatʼiy tiplashtirish kabi xususiyatlarga ega boʻlmaydi. JavaScript, Java dasturlash tilidan farq qilib, sinf tushunchasi bu tilning asosiy sintaktik qurilmasi hisoblanmaydi. Bunday asos sifatida foydalanilayotgan tizim tomonidan qolllab-quvvatlanayotgan, oldindan aniqlangan maʼlumot tiplari: sonli, mantiqiy va satrli; mustaqil ham boʻlishi, jismning usuli sifatida ham ishlatilishi mumkin bollgan funksiyalar; katta sondagi uz xossalariga va usullariga ega boʻlgan hamda oldindan aniqlangan jismlardan iborat jismli model va yana dastur ichida foydalanuvchi tomonidan yangi jismlarni berish qoidalari hisoblanadi.
JavaScriptʼda dasturlar yaratish uchun hech qanday qoʻshimcha vositalar kerak boʻlmaydi, faqatgina tegishli versiyadagi JavaScript qoʻllanishi mumkin boʻlgan brauzer va DHTML hujjatlarni yaratishga imkon beruvchi matn muharriri kerak boʻladi.<ref>{{citeWeb webmanbasi|title="JavaScript" dasturi va uning imkoniyatlari|url=http://tami.uz/matnga_qarang.php?id=438|accessdate=18-fevral, 2018}}</ref>
 
== Sintaksis ==
=== Oddiy namunalar ===
JavaScriptda oʻzgaruvchilarni <tt>var</tt>,<ref>{{citeWeb webmanbasi | url=https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/var | title=var – JavaScript – MDN | publisher=The [[Mozilla Developer Network]] | accessdate=22 December-dekabr 2012-yil}}</ref> <tt>let</tt><ref name="moz_let">{{citeWeb webmanbasi |title=let |url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/let |website=MDN web docs |publisher=Mozilla |accessdate=27 June-iyun 2018-yil |ref=moz_let}}</ref> yoki <tt>const</tt><ref name="moz_const">{{citeWeb webmanbasi |title=const |url=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const |website=MDN web docs |publisher=Mozilla |accessdate=27 June-iyun 2018-yil |ref=moz_const}}</ref> kalitsoʻzlari orqali qoʻying.
<syntaxhighlight lang="javascript">
var x; // declares the variable x and assigns to it the special value „undefined“ (not to be confused with an undefined value)
271 940

ta tahrir