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
console.log(typeof name); // find out what name is. console result 'string'
24
+
25
+
26
+
let firstName = 'Dylan';
27
+
let lastName = 'Israel';
28
+
29
+
console.log(firstName + '' + lastName); // concatenation '' give space in between two vars
30
+
//result Dyalan Israel
31
+
32
+
console.log(`${firstName} ${lastName}`); // new method called string interpolation
33
+
console.log( `${firstName} ${lastName}`.length); // string property, function length to show the length
34
+
console.log( `${firstName} ${lastName}`.trim().length); // trims all the spaces and counts the characters
35
+
console.log(`${firstName} ${lastName}`.toUpperCase()); //change all to upper case or even lower case using toLowerCase()
36
+
console.log(`${firstName} ${lastName}`.split(' ')); // split this once it detects the space, our value will be an array ["Dylan", "Israel"], if using just split('') it can break each of the letters individually
0 commit comments