Last login: Wed Jan 19 10:02:51 on ttys002 The default interactive shell is now zsh. To update your account to use zsh, please run `chsh -s /bin/zsh`. For more details, please visit https://support.apple.com/kb/HT208050. MAC:Wed Jan 19:10:31:~> ssh morrison@cs.ncssm.edu morrison@cs.ncssm.edu's password: Last login: Wed Jan 19 10:03:18 2022 from 172.31.248.160 CSWed Jan 19:10:31:~> node > function f(x, y){ return x*y;} undefined > f(4,5) 20 > typeof true 'boolean' > typeof 5 'number' > typeof f 'function' > let g = function(x, y) {return x*y;} undefined > g [Function: g] > g(3,4) 12 > const h = (x, y) => x*y; undefined > h(4,5) 20 > f = 20 20 > typeof f 'number' > x ReferenceError: x is not defined > const a = [1,2,3]; undefined > z ReferenceError: z is not defined > a [ 1, 2, 3 ] > a[0] 1 > a[0] = 5 5 > a [ 5, 2, 3 ] > // if is exactly the same as Java undefined > //while same as Java undefined > for(let k = 0; k < 10; k++){console.log(k);} 0 1 2 3 4 5 6 7 8 9 undefined > a [ 5, 2, 3 ] > for(k in a){console.log(k);} 0 1 2 undefined > for(k of a){console.log(k);} 5 2 3 undefined > CSWed Jan 19:11:00:~>