1. 變數

  2. 型別

  3. false

  4. Array

  5. Object

  6. Function

  7. undefined & null

  8. Math 物件

  9. 事件冒泡 Event bubbling

  10. ES6 知識

    1. var、let、const

      • 作用範圍不同 var ⇒ 最小單位 function , let const ⇒ 範圍 {}
      • const 不能重新賦值
    2. Module、impor、export

      • 給定變數

        // a.js
        export const aString = 'This is a string'
        export function aFunction() {
        	console.log('This is a function')
        }
        export const aObject = {
        	a: 1
        }
        
        // b.js
        import { aString, aFunction, aObject } from './a.js'
        console.log(aString)
        console.log(aObject)
        aFunction()
        
      • 不給變數

        // c.js
        export default function() {
        	console.log('This is a function')
        }
        
        // d.js
        import getFunction from './c.js'
        getFunction()
        
    3. 箭頭 function 與 this

    4. Template literals

    5. 解構賦值

      • 物件
      const user = {
      	id: 42,
      	displayName: 'BenC',
      	fullName: {
      		firstName: 'Ben',
      		lastName: 'Chou'
      	}
      }
      
      const { id, displayName, fullName } = user
      
      console.log(id)
      console.log(displayName)
      console.log(fullName)
      
      • 陣列
      const number = [1, 2, 3, 4, 5]
      
      const [x, y] = number
      
      console.log(x)
      console.log(y)
      
    6. 展開運算子

      • 通常用在陣列或是函式的參數

        const frameworks = ['vue', 'angular', 'react']
        const arr = ['awesome', ...frameworks]
        
        console.log(arr)
        
      • 其餘運算子

        const [a, b, ...others] = arr
        
        console.log(a)
        console.log(b)
        console.log(others)
        
      • 物件

        const { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 }
        
        console.log(x)
        console.log(y)
        console.log(z)
        
        const obj = { x, y, ...z }
        
        console.log(obj)
        
    7. async & awiat

      function asyncFunc1() {
      	retrun new Promise((resolve, reject) => {
      		
      	})
      }
      function asyncFunc2() {
      	retrun new Promise((resolve, reject) => {
      		
      	})
      }
      
      const asyncCall = async () => {
      	const result1 = await asyncFunc1()
      	const result2 = await asyncFunc2()
      }
      
    8. 優化

      • 字符串轉換,採用:"" + 1
      • 循環比較:少用 for(in) ⇒ for(;;) = while() > for(in)
      • 陣列長度緩存:如果需要遍歷陣列,建議先緩存起來,避免多次查詢陣列長度

    Filter 函式

    Map 函式

    Reduce 函式