We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce92942 commit 90218f1Copy full SHA for 90218f1
main.js
@@ -0,0 +1,22 @@
1
+// let result = "5" - 2; we can covert this to a string the results are he same.
2
+let result = String (("5" - 2));
3
+console.log("The result is: " + result);
4
+
5
+// let isValid = Boolean("false");
6
+let isValid = Boolean("flase");
7
+if (isValid) {
8
+ // console.log("This is valid."); convert this line to boolean. because it is a text this is true.
9
+ console.log(Boolean("This is valid"));
10
11
+}
12
13
+let age = "25";
14
+// let totalAge = age + 5; (convert 25 into a number)
15
+let totalAge = Number (age) + 5;
16
+console.log("Total Age: " + totalAge);
17
18
+let inValid = 0
19
+console.log(Boolean(inValid));
20
21
+let studentGrade = 83.5
22
+console.log(parseInt(studentGrade));
0 commit comments