You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/06-type-conversions/1-primitive-conversions-questions/solution.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,10 @@ undefined + 1 = NaN // (6)
17
17
"\t\n"-2=-2// (7)
18
18
```
19
19
20
-
1.The addition with a string`"" + 1`converts`1`to a string: `"" + 1 = "1"`, and then we have `"1" + 0`, the same rule is applied.
21
-
2.The subtraction `-` (like most math operations) only works with numbers, it converts an empty string `""`to`0`.
22
-
3.The addition with a string appends the number `5`to the string.
23
-
4.The subtraction always converts to numbers, so it makes `" -9 "`a number `-9`(ignoring spaces around it).
24
-
5.`null`becomes`0`after the numeric conversion.
25
-
6.`undefined`becomes `NaN`after the numeric conversion.
26
-
7.Space characters, are trimmed off string start and end when a string is converted to a number. Here the whole string consists of space characters, such as `\t`, `\n`and a "regular" space between them. So, similarly to an empty string, it becomes`0`.
20
+
1.কোন স্টিংয়ের সাথে যোগের ক্ষেত্রে`"" + 1`তে`1`রূপান্তর হয়ে `"" + 1 = "1"` হয়। তাই এখানে আমরা পাই `"1" + 0`, এক্ষেত্রেও একই নিয়ম প্রযোজ্য।
21
+
2.বিয়োগ `-` (প্রায় অন্যসব অপারেটরের মতই) শুধুমাত্র সংখ্যা নিয়ে কাজ করে, এটি ফাঁকা স্টিংকে শূন্য তে রূপান্তর করে নেয় `""`থেকে`0` হবে।
22
+
3.স্টিং সংযুক্তকরণ নীতি অনুসারে `5`স্টিংয়ে রূপান্তর হবে।
23
+
4.বিয়োগের সময় স্টিং সর্বদাই সংখ্যায় রূপান্তর হয়, তাই এক্ষেত্রে `" -9 "`সংখ্যা `-9`তে পরিবর্তন হয় (এখানে স্পেসগুলিকে উপেক্ষা করে )
24
+
5.`null`হবে`0`সংখ্যায় রুপান্তরের পর।
25
+
6.`undefined`হয়ে যায় `NaN`সংখ্যায় রূপান্তর করা হলে।
26
+
7.স্পেসসমূহ বাদ দেয়া হয় সংখ্যায় রুপান্তর করলে, এখানে পুরো স্টিংটাই বিভিন্ন স্পেসে তৈরি, যেমনঃ `\t`, `\n`এবং তাদের মাঝের "রেগুলার" স্পেসসমূহ। সুতরাং এটি ফাঁকা স্টিংয়ের মতই, যা শুন্যতে`0` রুপান্তর হয়।
প্রায় সব গানিতিক অপারেটর ভ্যালুকে সংখ্যায় রূপান্তর করে নেয়। তবে উল্লেখযোগ্য ব্যতিক্রম হলো যোগ `+`, যদি এর দুপাশের একটি ভ্যালুও স্টিং হয় তবে অপরটিও স্টিং হয়ে যাবে
85
+
প্রায় সব গানিতিক অপারেটর ভ্যালুকে সংখ্যায় রূপান্তর করে নেয়। তবে উল্লেখযোগ্য একটি ব্যতিক্রম হলো যোগ `+`, যদি এর দুপাশের একটি ভ্যালুও স্টিং হয় তবে অপরটিও স্টিং হয়ে যাবে
0 commit comments