ECMAScript 2016 ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ


فهرست مطالب

    نمایش فهرست مطالب

ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﺨﺴﻧ ﻩﺭﺎﻤﺷ

.ES6 (2015) ﻭ ES5 (2009) :ﺪﻧﺍ ﻩﺪﺷ ﯼﺭﺍﺬﮕﻣﺎﻧ ﺩﺍﺪﻋﺍ ﺎﺑ JS ﯽﻤﯾﺪﻗ ﯼﺎﻫ ﻪﺨﺴﻧ

... ،ECMAScript 2016، 2017، 2018، 2019 :ﺪﻧﻮﺷ ﯽﻣ ﯼﺭﺍﺬﮕﻣﺎﻧ ﻝﺎﺳ ﺱﺎﺳﺍ ﺮﺑ ﺎﻫ ﻪﺨﺴﻧ ،2016 ﻝﺎ

ECMAScript 2016 ﺭﺩ ﺪﯾﺪﺟ ﯼﺎﻫ ﯽﮔﮋﯾﻭ

:ﺪﻨﮐ ﯽﻣ ﯽﻓﺮﻌﻣ ﺍﺭ ECMAScript 2016 ﺪﯾﺪﺟ ﯼﺎﻫ ﯽﮔﮋﯾﻭ ﻞﺼﻓ ﻦﯾﺍ

  • (**) ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺖﯿﻠﺑﺎﻗ

  • (=**) ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺕﺭﺪﻗ ﺺﯿﺼﺨﺗ

  • ﺖﺳﺍ ()ﻞﻣﺎﺷ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﯾﺍﺭﺁ


ﻥﺍﻮﺗ ﺭﻮﺗﺍﺮﭘﺍ

.ﺪﻫﺩ ﯽﻣ ﺶﯾﺍﺰﻓﺍ ﻡﻭﺩ ﺪﻧﻮﻠﻤﻋ ﻥﺍﻮﺗ ﻪﺑ ﺍﺭ ﻝﻭﺍ ﺪﻧﻮﻠﻤﻋ b> (**

ﻝﺎﺜﻣ

let x = 5;
let z = x ** 2;

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>The ** Operator</h2>

<p id="demo"></p>

<script>
let x = 5;
let z = x ** 2;
document.getElementById("demo").innerHTML = z;
</script>

</body>
</html>

x ** y ﻪﮐ ﺪﻨﮐ ﯽﻣ ﺩﺎﺠﯾﺍ ﺍﺭ ﻪﺠﯿﺘﻧ ﻥﺎﻤﻫ

ﻝﺎﺜﻣ

let x = 5;
let z = Math.pow(x,2);

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>Math.pow()</h2>

<p id="demo"></p>

<script>
let x = 5;
let z = Math.pow(x, 2)
document.getElementById("demo").innerHTML = z;
</script>

</body>
</html>

ﻥﺍﻮﺗ ﺺﯿﺼﺨﺗ

ﻝﺎﺜﻣ

let x = 5;
x **= 2;

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>

<h2>Exponentiation Assignment (**=)</h2>

<p id="demo"></p>

<script>
let x = 5;
x **= 2;
document.getElementById("demo").innerHTML = x;
</script>

</body>
</html>

Operator Exponentiation ﺩﻮﺷ ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 2017 ﺱﺭﺎﻣ ﺯﺍ:

Chrome 52 Edge 14 Firefox 52 Safari 10.1 Opera 39
Jul 2016 Aug 2016 Mar 2017 Mar 2017 Aug 2016


()ﻞﻣﺎﺷ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻪﯾﺍﺭﺁ

ECMAScript 2016 Array.includes ﺩﺮﮐ ﯽﻓﺮﻌﻣ ﺎﻫ ﻪﯾﺍﺭﺁ ﻪﺑ

:ﺮﯿﺧ ﺎﯾ ﺩﺭﺍﺩ ﺩﻮﺟﻭ ﻪﯾﺍﺭﺁ ﮏﯾ ﺭﺩ ﺮﺼﻨﻋ ﮏﯾ ﺎﯾﺁ ﻪﮐ ﻢﯿﻨﮐ ﯽﺳﺭﺮﺑ ﺪﻫﺩ ﯽﻣ ﻥﺎﮑﻣﺍ ﺎﻣ ﻪﺑ ﻦﯾﺍ

ﻝﺎﺜﻣ

const fruits = ["Banana", "Orange", "Apple", "Mango"];

fruits.includes("Mango");

→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ

<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Arrays</h1>
<h2>The includes() Method</h2>

<p>Check if the fruit array contains "Mango":</p>

<p id="demo"></p>

<p><strong>Note:</strong> The includes method is not supported in Edge 13 (and earlier versions).</p>

<script>
const fruits = ["Banana", "Orange", "Apple", "Mango"];
document.getElementById("demo").innerHTML = fruits.includes("Mango");
</script>

</body>
</html>

Array.includes ﯽﻣ ﯽﻧﺎﺒﯿﺘﺸﭘ ﻥﺭﺪﻣ ﯼﺎﻫﺮﮔﺭﻭﺮﻣ ﻪﻤﻫ ﺭﺩ 201

Chrome 47 Edge 14 Firefox 43 Safari 9 Opera 34
Dec 2015 Aug 2016 Dec 2015 Oct 2015 Dec 2015

تمامی حقوق محفوظ است. © BasicIT.org • 2023-2024