:ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫﻩﺭﺎﻤﺷ ﻪﻤﻫ ﺭﺩ ﻥﺍﻮﺗﯽﻣ ﺍﺭ ﯼﺩﺪﻋ ﯼﺎﻫﺵﻭﺭ ﻦﯾﺍ
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﻪﺘﺷﺭ ﺕﺭﻮﺻ ﻪﺑ ﺍﺭ ﯼﺩﺪﻋ
ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺖﺳﺍ ﻩﺪﺷ ﻪﺘﺷﻮﻧ ﯽﯾﺎﻤﻧ ﺩﺎﻤﻧ ﺎﺑ ﻪﮐ ﺍﺭ ﯼﺩﺪﻋ
ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺖﺳﺍ ﻩﺪﺷ ﻪﺘﺷﻮﻧ ﺭﺎﺸﻋﺍ ﯼﺩﺍﺪﻌﺗ ﺎﺑ ﻪﮐ ﺍﺭ ﯼﺩﺪﻋ
ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺍﺭ ﺺﺨﺸﻣ ﻝﻮﻃ ﺎﺑ ﻩﺪﺷ ﻪﺘﺷﻮﻧ ﺩﺪﻋ ﮏﯾ
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺩﺪﻋ ﺕﺭﻮﺻ ﻪﺑ ﺍﺭ ﺩﺪﻋ ﮏﯾ
.ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﻪﺘﺷﺭ ﻥﺍﻮﻨﻋ ﻪﺑ ﺍﺭ ﺩﺪﻋ ﮏﯾ toString()
ﺵﻭﺭ
:ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ (ﺕﺍﺭﺎﺒﻋ ﺎﯾ ﺎﻫﺮﯿﻐﺘﻣ ،ﯽﻈﻔﻠﻟﺍ) ﺩﺍﺪﻋﺍ ﻉﻮﻧ ﺮﻫ ﺭﺩ ﻥﺍﻮﺗﯽﻣ ﺍﺭ ﺩﺍﺪﻋﺍ ﯼﺎﻫﺵﻭﺭ ﻪﻤﻫ
let x = 123;
x.toString();
(123).toString();
(100 + 23).toString();
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Number Methods</h2>
<p>The toString() method converts a number to a string.</p>
<p id="demo"></p>
<script>
let x = 123;
document.getElementById("demo").innerHTML =
x.toString() + "<br>" +
(123).toString() + "<br>" +
(100 + 23).toString();
</script>
</body>
</html>
toExponential()
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﻩﺪﺷ ﻪﺘﺷﻮﻧ ﯽﯾﺎﻤﻧ ﺩﺎﻤﻧ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺎﺑ ﻭ ﻩﺪﺷ ﺩﺮﮔ ﺩﺪﻋ ﺎﺑ ﻪﺘﺷﺭ
:ﺪﻨﮐ ﯽﻣ ﺺﺨﺸﻣ ﺍﺭ ﺭﺎﺸﻋﺍ ﻪﻄﻘﻧ ﺖﺸﭘ ﯼﺎﻫﺮﺘﮐﺍﺭﺎﮐ ﺩﺍﺪﻌﺗ ﺮﺘﻣﺍﺭﺎﭘ ﮏﯾ
let x = 9.656;
x.toExponential(2);
x.toExponential(4);
x.toExponential(6);
.ﺪﻨﮐ ﯽﻤﻧ ﺩﺮﮔ ﺍﺭ ﺩﺪﻋ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ،ﺪﯿﻨﮑﻧ ﺺﺨﺸﻣ ﺍﺭ ﻥﺁ ﺮﮔﺍ .ﺖﺳﺍ ﯼﺭﺎﯿﺘﺧﺍ ﺮﺘﻣﺍﺭﺎﭘ
toFixed()
ﯽﻣﺮﺑ ﻩﺭﺎﻤﺷ ﺎﺑ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾﺪﻧﺍﺩﺮﮔ
let x = 9.656;
x.toFixed(0);
x.toFixed(2);
x.toFixed(4);
x.toFixed(6);
toFixed(2)
ﺖﺳﺍ ﯽﻟﺎﻋ ﻝﻮﭘ ﺎﺑ ﺭﺎﮐ ﯼﺍﺮﺑ.
toPrecision()
ﺎﺑ ﻩﺪﺷ ﻪﺘﺷﻮﻧ ﺩﺪﻋ ﮏﯾ ﺎﺑ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ
let x = 9.656;
x.toPrecision();
x.toPrecision(2);
x.toPrecision(4);
x.toPrecision(6);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Number Methods</h2>
<p>The toPrecision() method returns a string, with a number written with a specified length:</p>
<p id="demo"></p>
<script>
let x = 9.656;
document.getElementById("demo").innerHTML =
x.toPrecision() + "<br>" +
x.toPrecision(2) + "<br>" +
x.toPrecision(4) + "<br>" +
x.toPrecision(6);
</script>
</body>
</html>
valueOf()
ﯽﻣﺮﺑ ﺩﺪﻋ ﻥﺍﻮﻨﻋ ﻪﺑ ﺍﺭ ﺩﺪﻋ ﮏﯾﺪﻧﺍﺩﺮﮔ.
let x = 123;
x.valueOf();
(123).valueOf();
(100 + 23).valueOf();
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Number Methods</h2>
<p>The valueOf() method returns a number as a number:</p>
<p id="demo"></p>
<script>
let x = 123;
document.getElementById("demo").innerHTML =
x.valueOf() + "<br>" +
(123).valueOf() + "<br>" +
(100 + 23).valueOf();
</script>
</body>
</html>
ﺪﺷﺎﺑ ﮏﯾ ﺎﯾ (ﺩﺪﻋ=ﻉﻮﻧ) ﻪﯿﻟﻭﺍ ﺭﺍﺪﻘﻣ ﮏﯾ ﺪﻧﺍﻮﺗ ﯽﻣ ﺩﺪﻋ ﮏﯾ ،ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ
ﺩﻮﺷ ﯽﻣ ﻩﺩﺎﻔﺘﺳﺍ ﻩﺭﺎﻤﺷ ﻞﯾﺪﺒﺗ ﯼﺍﺮﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺭﺩ ﯽﻠﺧﺍﺩ ﺕﺭﻮﺻ ﻪﺑ valueOf()
ﺵﻭﺭ
.ﺩﺭﺍﺪﻧ ﺩﻮﺟﻭ ﺎﻤﺷ ﺪﮐ ﺭﺩ ﻥﺁ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﯼﺍﺮﺑ ﯽﻠﯿﻟﺩ
.ﺪﻨﺘﺴﻫ toString()
ﮏﯾ ﻭ valueOf()
ﺵﻭﺭ ﮏﯾ ﯼﺍﺭﺍﺩ ﺖﭙﯾﺮﮑ
ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺎﻬﻧﺁ ﺯﺍ ﻥﺍﻮﺗ ﯽﻣ ﻪﮐ ﺩﺭﺍﺩ ﺩﻮﺟﻭ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺵﻭﺭ 3
.ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺍﺭ ﺩﻮﺧ ﻥﺎﻣﻮﮔﺭﺁ ﺯﺍ ﻩﺪﺷ ﻞﯾﺪﺒﺗ ﺩﺪﻋ
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺭﻭﺎﻨﺷ ﺰﯿﻤﻣ ﺩﺪﻋ ﮏﯾ ﻭ ﺪﻨﮐ ﯽﻣ ﻪﯾﺰﺠﺗ ﺍﺭ ﻥﺁ ﻥﺎﻣﻮﮔﺭﺁ
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﻞﻣﺎﮐ ﺩﺪﻋ ﮏﯾ ﻭ ﺪﻨﮐ ﯽﻣ ﻪﯾﺰﺠﺗ ﺍﺭ ﻥﺁ ﻥﺎﻣﻮﮔﺭﺁ
.ﺪﻨﺘﺴﻫ ﯽﻧﺎﻬﺟ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫ ﺵﻭﺭ ﺎﻬﻧﺁ .ﺪﻨﺘﺴﯿﻧ ﯼﺩﺪﻋ ﯼﺎﻫﺵﻭﺭ ﻻﺎﺑ ﯼﺎﻫﺵﻭﺭ
:ﺩﺮﮐ ﻩﺩﺎﻔﺘﺳﺍ ﺩﺍﺪﻋﺍ ﻪﺑ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯼﺎﻫﺮﯿﻐﺘﻣ ﻞﯾﺪﺒﺗ ﯼﺍﺮﺑ ﻥﺍﻮﺗ ﯽﻣ Number()
ﺵﻭﺭ ﺯﺍ
Number(true);
Number(false);
Number("10");
Number(" 10");
Number("10 ");
Number(" 10 ");
Number("10.33");
Number("10,33");
Number("10 33");
Number("John");
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Global Methods</h2>
<p>The Number() method converts variables to numbers:</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
Number(true) + "<br>" +
Number(false) + "<br>" +
Number("10") + "<br>" +
Number(" 10") + "<br>" +
Number("10 ") + "<br>" +
Number(" 10 ") + "<br>" +
Number("10.33") + "<br>" +
Number("10,33") + "<br>" +
Number("10 33") + "<br>" +
Number("John");
</script>
</body>
</html>
.ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ (ﺩﺪﻋ ﮏﯾ ﻪﻧ) NaN
،ﺪﺷﺎﺒﻧ ﻞﯾﺪﺒﺗ ﻞﺑﺎﻗ ﺩﺪﻋ ﺮﮔﺍ
Number()
ﺪﻨﮐ ﻞﯾﺪﺒﺗ ﺩﺪﻋ ﻪﺑ ﺍﺭ ﺦﯾﺭﺎﺗ ﺪﻧﺍﻮﺗ ﯽﻣ ﻦﯿﻨﭽﻤﻫ.
Number(new Date("1970-01-01"))
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Global Methods</h2>
<p>The Number() method can convert a date to a number:</p>
<p id="demo"></p>
<script>
let x = new Date("1970-01-01");
document.getElementById("demo").innerHTML = Number(x);
</script>
</body>
</html>
.ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ 1.1.1970 ﺯﺍ ﺍﺭ ﺎﻫ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﺩﺍﺪﻌﺗ Date()
ﺵﻭﺭ
:ﺖﺳﺍ 86400000 1970-01-01 ﻭ 1970-01-02 ﻦﯿﺑ ﻪﯿﻧﺎﺛ ﯽﻠﯿﻣ ﺩﺍﺪﻌﺗ
Number(new Date("1970-01-02"))
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Global Methods</h2>
<p>The Number() method can convert a date to a number:</p>
<p id="demo"></p>
<script>
let x = new Date("1970-01-02");
document.getElementById("demo").innerHTML = Number(x);
</script>
</body>
</html>
Number(new Date("2017-09-30"))
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h2>JavaScript Global Methods</h2>
<p>The Number() method can convert a date to a number:</p>
<p id="demo"></p>
<script>
let x = new Date("2017-09-30");
document.getElementById("demo").innerHTML = Number(x);
</script>
</body>
</html>
parseInt()
ﺪﻨﺘﺴﻫ ﺎﻫﺎﻀﻓ .ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﻞﻣﺎﮐ ﺩﺪﻋ ﮏﯾ ﻭ ﺪﻨﮐ ﯽﻣ ﻪﯾﺰﺠﺗ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ
parseInt("-10");
parseInt("-10.33");
parseInt("10");
parseInt("10.33");
parseInt("10 20 30");
parseInt("10 years");
parseInt("years 10");
.ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ (ﺩﺪﻋ ﮏﯾ ﻪﻧ) NaN
،ﺪﺷﺎﺒﻧ ﻞﯾﺪﺒﺗ ﻞﺑﺎﻗ ﺩﺪﻋ ﺮﮔﺍ
parseFloat()
ﺪﻨﺘﺴﻫ ﺎﻫﺎﻀﻓ .ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﺩﺪﻋ ﮏﯾ ﻭ ﺪﻨﮐ ﯽﻣ ﻪﯾﺰﺠﺗ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ
parseFloat("10");
parseFloat("10.33");
parseFloat("10 20 30");
parseFloat("10 years");
parseFloat("years 10");
.ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ (ﺩﺪﻋ ﮏﯾ ﻪﻧ) NaN
،ﺪﺷﺎﺒﻧ ﻞﯾﺪﺒﺗ ﻞﺑﺎﻗ ﺩﺪﻋ ﺮﮔﺍ
:ﺖﺳﺍ Number ﯽﺷ ﻪﺑ ﻖﻠﻌﺘﻣ ﯽﺷ ﯼﺎﻫﺵﻭﺭ ﻦﯾﺍ
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ true ﺭﺍﺪﻘﻣ ﺪﺷﺎﺑ ﺢﯿﺤﺻ ﺩﺪﻋ ﮏﯾ ﻥﺎﻣﻮﮔﺭﺁ ﺮﮔﺍ
ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺍﺭ true ،ﺪﺷﺎﺑ ﻦﻣﺍ ﺢﯿﺤﺻ ﺩﺪﻋ ﮏﯾ ﻥﺎﻣﻮﮔﺭﺁ ﺮﮔﺍ
ﺪﻨﮐ ﯽﻣ ﻞﯾﺪﺒﺗ ﺩﺪﻋ ﻪﺑ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ
ﺪﻨﮐ ﯽﻣ ﻞﯾﺪﺒﺗ ﻞﻣﺎﮐ ﺩﺪﻋ ﻪﺑ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ
.ﺪﻨﺘﺴﻫ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﯽﺷ ﻩﺭﺎﻤﺷ ﻪﺑ ﻖﻠﻌﺘﻣ ﻻﺎﺑ ﯼﺩﺪﻋ ﯼﺎﻫﺵﻭﺭ
.ﺪﻨﺘﺴﻫ ﯽﺳﺮﺘﺳﺩ ﻞﺑﺎﻗ Number.isInteger()
ﺪﻨﻧﺎﻣ ﻂﻘﻓ ﺎﻫﺵﻭﺭ ﻦﯾﺍ
:ﺩﻮﺷ ﯽﻣ ﺎﻄﺧ ﮏﯾ ﻪﺑ ﺮﺠﻨﻣ ،ﺖﺳﺍ ﺮﯿﻐﺘﻣ ﮏﯾ X ﻥﺁ ﺭﺩ ﻪﮐ()X.isInteger ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ
TypeError X.isInteger ﺖﺴﯿﻧ ﻊﺑﺎﺗ ﮏﯾ
.
.ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺍﺭ Number.isInteger()
true
ﺵﻭﺭ ،ﺪﺷ
Number.isInteger(10);
Number.isInteger(10.5);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>The isInteger() Method</h2>
<p>The isInteger() method returns true if the argument is an integer.</p>
<p>Otherwise it returns false.</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
Number.isInteger(10) + "<br>" + Number.isInteger(10.5);
</script>
</body>
</html>
.ﺩﻮﺷ ﻩﺩﺍﺩ ﺶﯾﺎﻤﻧ ﺮﺑﺍﺮﺑ ﻭﺩ ﻖﯿﻗﺩ ﺩﺪﻋ ﮏﯾ ﻥﺍﻮﻨﻋ ﻪﺑ ﺪﻧﺍﻮﺗ ﯽﻣ ﺎﻘﯿﻗﺩ ﻪﮐ ﺖﺳﺍ ﺢﯿﺤﺻ ﺩﺪﻋ ﮏﯾ ﻦﻤﯾﺍ ﺢﯿﺤﺻ ﺩﺪﻋ ﮏﯾ
.ﺪﻧﺍﺩﺮﮔﯽﻣﺮﺑ ﺍﺭ Number.isSafeInteger()
true
ﺵﻭﺭ
Number.isSafeInteger(10);
Number.isSafeInteger(12345678901234567890);
→ ﺪﯿﻨﮐ ﻥﺎﺤﺘﻣﺍ ﺍﺭ ﻥﺁ ﻥﺎﺗﺩﻮﺧ
<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Numbers</h1>
<h2>The isSafeInteger() Method</h2>
<p>The isSafeInteger() method returns true if the argument is a safe integer.</p>
<p>Otherwise it returns false.</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
Number.isSafeInteger(10) + "<br>" + Number.isSafeInteger(12345678901234567890);
</script>
</body>
</html>
.ﺪﻨﺘﺴﻫ (sup>53 - 1>2)+ ﺎﺗ (sup>53 - 1>2)- ﺯﺍ ﺢﯿﺤﺻ ﺩﺍﺪﻋﺍ ﻪﻤﻫ ﻦﻣﺍ ﺢﯿﺤﺻ ﺩﺍﺪﻋﺍ
Number.parseFloat()
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﺩﺪﻋ ﮏﯾ ﻭ ﺪﻨﮐ ﯽﻣ ﻪﯾﺰﺠﺗ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ.
:ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ ﻝﻭﺍ ﻩﺭﺎﻤﺷ ﻂﻘﻓ .ﺖﺳﺍ ﺯﺎﺠﻣ ﺎﻫﺎﻀﻓ
Number.parseFloat("10");
Number.parseFloat("10.33");
Number.parseFloat("10 20 30");
Number.parseFloat("10 years");
Number.parseFloat("years 10");
.ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ (ﺩﺪﻋ ﮏﯾ ﻪﻧ) NaN
،ﺪﺷﺎﺒﻧ ﻞﯾﺪﺒﺗ ﻞﺑﺎﻗ ﺩﺪﻋ ﺮﮔﺍ
Number Number.parseInt()
ﯼﺎﻫﺵﻭﺭ
.(ﺮﮔﺭﻭﺮﻣ ﺯﺍ ﺝﺭﺎﺧ ﺭﺩ ﻪﺑﺎﺸﻣ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﺪﮐ ﺯﺍ ﻩﺩﺎﻔﺘﺳﺍ ﺖﻟﻮﻬﺳ ﯼﺍﺮﺑ) ﺖﺳﺍ ﺎﻫ ﯽﻧﺎﻬﺟ ﯼﺯﺎﺳﺭﻻﻭﮊﺎﻣ ﻑﺪﻫ
Number.parseInt()
ﺪﻧﺍﺩﺮﮔ ﯽﻣﺮﺑ ﺍﺭ ﻞﻣﺎﮐ ﺩﺪﻋ ﮏﯾ ﻭ ﺪﻨﮐ ﯽﻣ ﻪﯾﺰﺠﺗ ﺍﺭ ﻪﺘﺷﺭ ﮏﯾ.
:ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ ﻝﻭﺍ ﻩﺭﺎﻤﺷ ﻂﻘﻓ .ﺖﺳﺍ ﺯﺎﺠﻣ ﺎﻫﺎﻀﻓ
Number.parseInt("-10");
Number.parseInt("-10.33");
Number.parseInt("10");
Number.parseInt("10.33");
Number.parseInt("10 20 30");
Number.parseInt("10 years");
Number.parseInt("years 10");
.ﺩﻮﺷ ﯽﻣ ﻩﺪﻧﺍﺩﺮﮔﺮﺑ (ﺩﺪﻋ ﮏﯾ ﻪﻧ) NaN
،ﺪﺷﺎﺒﻧ ﻞﯾﺪﺒﺗ ﻞﺑﺎﻗ ﺩﺪﻋ ﺮﮔﺍ
:ﺪﯿﻨﮐ ﻪﻌﺟﺍﺮﻣ ﺎﻣ ﻪﺑ ،ﻩﺭﺎﻤﺷ ﻞﻣﺎﮐ ﻊﺟﺮﻣ ﮏﯾ ﯼﺍﺮﺑ
.ﻞﻣﺎﮐ ﺖﭙﯾﺮﮑﺳﺍ ﺍﻭﺎﺟ ﻩﺭﺎﻤﺷ ﻊﺟﺮﻣ
.ﺖﺳﺍ Number ﯼﺎﻫ ﺵﻭﺭ ﻭ ﺎﻫ ﯽﮔﮋﯾﻭ ﻡﺎﻤﺗ ﺯﺍ ﯽﯾﺎﻫ ﻪﻧﻮﻤﻧ ﻭ ﺕﺎﺤﯿﺿﻮﺗ ﯼﻭﺎﺣ ﻊﺟﺮﻣ