.ES6 (2015) ﻭ ES5 (2009) :ﺪﻧﺍ ﻩﺪﺷ ﯼﺭﺍﺬﮕﻣﺎﻧ ﺩﺍﺪﻋﺍ ﺎﺑ JS ﯽﻤﯾﺪﻗ ﯼﺎﻫ ﻪﺨﺴﻧ
... ،ECMAScript 2016، 2017، 2018، 2019 :ﺪﻧﻮﺷ ﯽﻣ ﯼﺭﺍﺬﮕﻣﺎﻧ ﻝﺎﺳ ﺱﺎﺳﺍ ﺮﺑ ﺎﻫ ﻪﺨﺴﻧ ،2016 ﻝﺎ
BigInt
()matchAll ﻪﺘﺷﺭ
(??) Nullish Coalescing ﺭﻮﺗﺍﺮﭘﺍ
(.?) ﯼﺍ ﻩﺮﯿﺠﻧﺯ ﯼﺭﺎﯿﺘﺧﺍ ﺭﻮﺗﺍﺮﭘﺍ
(=&&) ﯼﺭﺍﺬﮔﺍﻭ ﻭ ﯽﻘﻄﻨﻣ ﺮﮕﻠﻤﻋ
(=||) OR ﯽﻘﻄﻨﻣ ﺺﯿﺼﺨﺗ
(=??) ﺮﺛﺍ ﯽﺑ ﻡﺎﻏﺩﺍ ﻒﯿﻠﮑﺗ
Promise allSettled():style="word-wrap: break-word;">Pro
ﮏﯿﻣﺎﻨﯾﺩ ﺕﺍﺩﺭﺍﻭ
.ﺪﻨﺘﺴﻫ ﺪﯾﺪﺟ ﺎﺘﺒﺴﻧ ﺎﻫ ﯽﮔﮋﯾﻭ ﻦﯾﺍ
(Polyfill) ﺪﻨﺷﺎﺑ ﻪﺘﺷﺍﺩ ﺯﺎﯿﻧ ﻦﯾﺰﮕﯾﺎﺟ ﺪﮐ ﮏﯾ ﻪﺑ ﺖﺳﺍ ﻦﮑﻤﻣ ﯽﻤﯾﺪﻗ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ
.ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺢﯿﺤﺻ ﺩﺪﻋ ﮒﺭﺰﺑ ﺮﯾﺩﺎﻘﻣ ﻩﺮﯿﺧﺫ ﯼﺍﺮﺑ .ﺪﻨﺘﺴﻫ ﻖﯿﻗﺩ ﻢﻗﺭ 15 ﺩﻭﺪﺣ ﺎﺗ ﻂﻘﻓ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺢﯿﺤﺻ ﺩﺍﺪﻋﺍ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ .ﺪﯿﻨﮐ ﻪﻓﺎﺿﺍ ﯽﻧﺍﻮﺧﺍﺮﻓ ﺎﯾ ﺢﯿﺤﺻ ﺩﺪﻋ ﮏﯾ ﯼﺎﻬﺘﻧﺍ ﻪﺑ ﺍﺭ code class="w3-codespan">BigInt → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺎﻫﺩﺍﺪﺧﺭ ﻪﻤﻫ ﯼﻮﺠﺘﺴﺟ ﯼﺍﺮﺑ ﻥﺁ ﺯﺍ ﻥﺍﻮﺘﺑ ﻪﮐ ﺖﺷﺍﺪﻧ ﺩﻮﺟﻭ ﯼﺍ ﻪﺘﺷﺭ ﺵﻭﺭ ﭻﯿﻫ ES2020 → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ﺕﺭﻮﺻ ﻦﯾﺍ ﺮﯿﻏ ﺭﺩ ،ﺩﻮﺷ ﻢﯿﻈﻨﺗ ﺪﯾﺎﺑ (g) ﯽﻧﺎﻬﺟ ﻢﭼﺮﭘ ،ﺖﺳﺍ ﻢﻈﻨﻣ ﺕﺭﺎﺒﻋ ﮏﯾ ﺮﺘﻣﺍﺭﺎﭘ ﺮﮔﺍ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﻮﺷ ﻢﯿﻈﻨﺗ ﺪﯾﺎﺑ (i) ﺱﺎﺴﺣ ﺮﯿﻏ ﻢﭼﺮﭘ ،ﺪﯿﻨﮐ ﻮﺠﺘﺴﺟ ﺱﺎﺴﺣ ﺮﯿﻏ ﻑﻭﺮﺣ ﺎﺑ ﺪﯿﻫﺍﻮﺧﯽﻣ ﺮﮔﺍ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ ES2021 ﻪﺘﺷﺭ ﺪﺘﻣ()replaceAll ﺩﺮﮐ ﯽﻓﺮﻌﻣ ﺍﺭ. .ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺪﺷﺎﺒﻧ ﻞﻃﺎﺑ ﻪﮐ ﯽﺗﺭﻮﺻ ﺭﺩ ﺍﺭ ﻥﺎﻣﻮﮔﺭﺁ ﻦﯿﻟﻭﺍ .ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﯽﻣﻭﺩ ﺕﺭﻮﺻ ﻦﯾﺍ ﺮﯿﻏ ﺭﺩ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﻮﺷ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 2020 ﺱﺭﺎﻣ ﺯﺍ nullish ﺭﻮﺗﺍﺮﭘﺍ ﻩﺮﯿﺠﻧﺯ ﺭﻮﺗﺍﺮﭘﺍﯼﺭﺎﯿﺘﺧﺍ ﯼﺍ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﻮﺷ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ 2020 ﺱﺭﺎﻣ ﺯﺍ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ ﺮﮕﻠﻤﻋ Logical AND Assignment ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺭﺍﺪﻘﻣ ﻭﺩ ﻦﯿﺑ. .ﺩﻮﺷ ﯽﻣ ﻩﺩﺍﺩ ﺺﯿﺼﺨﺗ ﻡﻭﺩ ﺭﺍﺪﻘﻣ ،ﺪﺷﺎﺑ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﻮﺷﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 2020 ﺮﺒﻣﺎﺘﭙﺳ ﺯﺍ ﺺﯿﺼﺨﺗ ﺎﯾ ﯽﻘﻄﻨﻣ ﺭﻮﺗﺍﺮﭘﺍ ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺭﺍﺪﻘﻣ ﻭﺩ ﻦﯿﺑ. .ﺩﻮﺷ ﯽﻣ ﻩﺩﺍﺩ ﺺﯿﺼﺨﺗ ﻡﻭﺩ ﺭﺍﺪﻘﻣ ،ﺪﺷﺎﺑ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﻮﺷ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 2020 ﺮﺒﻣﺎﺘﭙﺳ ﺯﺍ Nullish Coalescing Assignment Operator ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﺭﺍﺪﻘﻣ ﻭﺩ ﻦﯿﺑ. .ﺩﻮﺷ ﯽﻣ ﻩﺩﺍﺩ ﺺﯿﺼﺨﺗ ﻡﻭﺩ ﺭﺍﺪﻘﻣ ،ﺪﺷﺎﺑ → ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ :ﺩﻮﺷ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 2020 ﺮﺒﻣﺎﺘﭙﺳ ﺯﺍ BigInt
ﺢﯿﺤﺻ ﺩﺪﻋ ﻝﺎﺜﻣ
let x = 999999999999999;
let y = 9999999999999999; // too big
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>Integer Precision</h2>
<p>Integers (numbers without a period or exponent notation) are accurate up to 15 digits:</p>
<p id="demo"></p>
<script>
let x = 999999999999999;
let y = 9999999999999999;
document.getElementById("demo").innerHTML = x + "<br>" + y;
</script>
</body>
</html>
BigInt ﻝﺎﺜﻣ
let x = 9999999999999999;
let y = 9999999999999999n;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>Integer and BigInt</h2>
<p id="demo"></p>
<script>
let x = 9999999999999999;
let y = BigInt("9999999999999999");
document.getElementById("demo").innerHTML = x + "<br>" + y;
</script>
</body>
</html>
ﻝﺎﺜﻣ
let x = 1234567890123456789012345n;
let y = BigInt(1234567890123456789012345)
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>Create a BigInt</h2>
<p id="demo"></p>
<script>
let x = 123456789012345678901234567890n;
let y = BigInt("123456789012345678901234567890");
document.getElementById("demo").innerHTML = x + "<br>" + y;
</script>
</body>
</html>
ﻉﻮﻧ
a BigInt
ﺖﭙﯾﺮﮑﺳ ﻝﺎﺜﻣ
let x = BigInt(999999999999999);
let type = typeof x;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>BigInt typeof</h2>
<p>The typeof a BigInt is:</p>
<p id="demo"></p>
<script>
let x = BigInt("9999999999999999");
document.getElementById("demo").innerHTML = typeof x;
</script>
</body>
</html>
BigInt
ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 2020 ﺮﺒﻣﺎﺘﭙ
Chrome 67
Edge 79
Firefox 68
Safari 14
Opera 54
May 2018
Jan 2020
Jul 2019
Sep 2020
Jun 2018
()matchAll ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﺘﺷﺭ
ﻝﺎﺜﻣ
const iterator = text.matchAll("Cats");
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Strings</h1>
<h2>The matchAll() Method</h2>
<p>ES2020 intoduced the string method matchAll().</p>
<p id="demo"></p>
<script>
let text = "I love cats. Cats are very easy to love. Cats are very popular."
const iterator = text.matchAll("Cats");
document.getElementById("demo").innerHTML = Array.from(iterator);
</script>
</body>
</html>
ﻝﺎﺜﻣ
const iterator = text.matchAll(/Cats/g);
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Strings</h1>
<h2>The matchAll() Method</h2>
<p>ES2020 intoduced the string method matchAll().</p>
<p id="demo"></p>
<script>
let text = "I love cats. Cats are very easy to love. Cats are very popular."
const iterator = text.matchAll(/Cats/g);
document.getElementById("demo").innerHTML = Array.from(iterator);
</script>
</body>
</html>
ﻝﺎﺜﻣ
const iterator = text.matchAll(/Cats/gi);
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Strings</h1>
<h2>The matchAll() Method</h2>
<p>ES2020 intoduced the string method matchAll().</p>
<p id="demo"></p>
<script>
let text = "I love cats. Cats are very easy to love. Cats are very popular."
const iterator = text.matchAll(/Cats/gi);
document.getElementById("demo").innerHTML = Array.from(iterator);
</script>
</body>
</html>
ﺪﯿﺷﺎﺑ ﻪﺘﺷﺍﺩ ﻪﺟﻮﺗ
(??) Nullish Coalescing ﺭﻮﺗﺍﺮﭘﺍ
ﻝﺎﺜﻣ
let name = null;
let text = "missing";
let result = name ?? text;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Operators</h1>
<h2>The ?? Operator</h2>
<p>The ?? operator returns the first argument if it is not nullish (null or undefined). Otherwise it returns the second.</p>
<p id="demo"></p>
<script>
let name = null;
let text = "missing";
let result = name ?? text;
document.getElementById("demo").innerHTML = "The name is " + result;
</script>
</body>
</html>
Chrome 80
Edge 80
Firefox 72
Safari 13.1
Opera 67
Feb 2020
Feb 2020
Jan 2020
Mar 2020
Mar 2020
(.?) ﯼﺍ ﻩﺮﯿﺠﻧﺯ ﯼﺭﺎﯿﺘﺧﺍ ﺭﻮﺗﺍﺮﭘﺍ
ﻩﺪﺸﻧ ﻒﯾﺮﻌﺗ
ﯽﻣﺮﺑ ﻝﺎﺜﻣ
const car = {type:"Fiat", model:"500", color:"white"};
let name = car?.name;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Operators</h1>
<h2>The ?. Operator</h2>
<p>The ?. operator returns undefined if an object is undefined or null (instead of throwing an error).</p>
<p>Car name is:</p>
<p id="demo"></p>
<script>
const car = {type:"Fiat", model:"500", color:"white"};
let name = car?.name;
document.getElementById("demo").innerHTML = name;
</script>
</body>
</html>
?.=
Chrome 80
Edge 80
Firefox 74
Safari 13.1
Opera 67
Feb 2020
Feb 2020
Mar 2020
Mar 2020
Mar 2020
=&& ﺭﻮﺗﺍﺮﭘﺍ
true
ﻝﻭﺍ ﺭﺍﺪﻘﻣ ﺮﮔ ﻒﯿﻠﮑﺗ ﻭ ﯽﻘﻄﻨﻣ ﻝﺎﺜﻣ
let x = 10;
x &&= 5;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Assignments</h1>
<h2>Logical AND Assignment</h2>
<h3>The &&= Operator</h3>
<p>If the first value is true, the second value is assigned.</p>
<p id="demo"></p>
<script>
let x = 100;
x &&= 5;
document.getElementById("demo").innerHTML = "Value of x is: " + x;
</script>
</body>
</html>
Chrome 85
Edge 85
Firefox 79
Safari 14
Opera 71
Aug 2020
Aug 2020
Mar 2020
Sep 2020
Sep 2020
=|| ﺭﻮﺗﺍﺮﭘﺍ
false
ﻝﻭﺍ ﺭﺍﺪﻘﻣ ﺮ OR ﯽﻘﻄﻨﻣ ﻝﺎﺜﻣ
let x = 10;
x ||= 5;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Assignments</h1>
<h2>Logical OR Assignment</h2>
<h3>The ||= Operator</h3>
<p>If the first value is false, the second value is assigned:</p>
<p id="demo"></p>
<script>
let x = undefined;
x ||= 5;
document.getElementById("demo").innerHTML = "Value of x is: " + x;
</script>
</body>
</html>
||=<
Chrome 85
Edge 85
Firefox 79
Safari 14
Opera 71
Aug 2020
Aug 2020
Mar 2020
Sep 2020
Sep 2020
ﺭﻮﺗﺍﺮﭘﺍ =??
null
ﺎﯾ ﻩﺪ
ﻞﻃﺎﺑ ﻡﺎﻏﺩﺍ ﺺﯿﺼﺨﺗ ﻝﺎﺜﻣ
let x;
x ??= 5;
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Assignments</h1>
<h2>The ??= Operator</h2>
<p>The ??= operator is used between two values. If the first value is undefined or null, the second value is assigned.</p>
<p id="demo"></p>
<script>
let x;
document.getElementById("demo").innerHTML = x ??= 5;
</script>
</body>
</html>
??=<
Chrome 85
Edge 85
Firefox 79
Safari 14
Opera 71
Aug 2020
Aug 2020
Mar 2020
Sep 2020
Sep 2020