Introduction
what should know
ES 6 syntax
1. What is a node.js
Node.js History
Node.js create 2009
NPM – 2011 – เพื่อ share open node.js library
Installing Node.js
> node -v
ถ้าต่ำกว่า 18 ให้ update
> npm -v
Using VSC /
2. Node Globals
Inspecting the global object 2.56/3.46
มีหลาย global objects , เช่นเมื่อเราใช้ console.log มันอยู่ใน global namespace เช่นเดียวกัน
> global.console.log(“Hello World”) ;
เหมือน global ของ window ใน browser
แต่เมื่อใช้ global.variable ใช้ไม่ได้เหมือน window, เพราะ variable นี้เป็น scope/ module
node.js ใช้ chrome v8 interpreter – สามารถใช้กับ primitives , objects , arrays , fn
สามารถใช้ let justNode = hello.slice(17);
