/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found) typeof 5 'number' type true VM188:1 Uncaught SyntaxError: Unexpected token 'true' typeof true 'boolean' typeof false 'boolean' 4 > 5 false 4 < 5 true 4 <= 5 true 2 + 2 === 4 true # this is isequalto === VM462:1 Uncaught SyntaxError: Invalid or unexpected token // this is isequalto === undefined 5 + 1 !== 3 true typeof "5" 'string' 5 == "5" true 5 == Number("5") true Number("45") 45 not true VM1197:1 Uncaught SyntaxError: Unexpected token 'true' !true false !(4 > 5) true !!true true !!false false true || true true true || false true true || false true false || false false // P || Q is true if at least one of P or Q is true undefined // || is OR undefined true && true true true && false false false && true false false && false false // P && Q is true when BOTH P and Q are true. undefined let x = 7 undefined x <= 8 && x > 5 true x >= 0 and x <= 10 VM2227:1 Uncaught SyntaxError: Unexpected identifier x >= 0 && x <= 10 true x = 15 15 x >= 0 && x <= 10 false //precedence not then and then or undefined let s = "this is a single-quoted string" undefined let t = 'this is a double-quoted string" VM2664:1 Uncaught SyntaxError: Invalid or unexpected token let t = 'this is a double-quoted string' undefined s 'this is a single-quoted string' t 'this is a double-quoted string' s + t 'this is a single-quoted stringthis is a double-quoted string' // + concatenates strings (glues 'em) undefined 6 + "cows" '6cows' //Javascript is a stringophile language. undefined string(6) VM3110:1 Uncaught ReferenceError: string is not defined at :1:1 (anonymous) @ VM3110:1 "" + 6 '6' String(6) '6' String(true) 'true' // this is casting undefined // a cast is a temporary request to regard an object of one type as being of another undefined Number("45") 45 Number("quack") NaN s = "abcdefghijlmnopqrstuvwxyz" 'abcdefghijlmnopqrstuvwxyz' s.toUpperCase() 'ABCDEFGHIJLMNOPQRSTUVWXYZ' s 'abcdefghijlmnopqrstuvwxyz' let u = s.toUpperCase() undefined u 'ABCDEFGHIJLMNOPQRSTUVWXYZ' u.toLowerCase() 'abcdefghijlmnopqrstuvwxyz' u.length 25 u[0] 'A' u 'ABCDEFGHIJLMNOPQRSTUVWXYZ' u[15] 'Q' u[25] undefined u.substring(2,5) 'CDE' u.substring(2,5) + u.substring(5,7) 'CDEFG' s 'abcdefghijlmnopqrstuvwxyz' s.substring(2,5) 'cde' //methods depend on the state of their object undefined //state: what an object KNOWS undefined //behavior: what an object DOES undefined //identity: presence in memory undefined s.length 25 filename = "cows.jpg" 'cows.jpg' filename.endsWith(".jpg") true filename.startsWith("c") true filename.charAt(3) 's' filename.includes(".jpeg") false filename.includes(".jpg") true filename.indexO("z") VM5876:1 Uncaught TypeError: filename.indexO is not a function at :1:10 (anonymous) @ VM5876:1 filename.indexOf("z") -1 filename 'cows.jpg' filename.indexOf("p") 6 filename.indexOf("q") -1