jQuery 的 once
btns.forEach((elem) => {
  elem.addEventListener('click', function listener(e){
    console.log(e.target.id)
    // 事件種類 ,  Function名
    this.removeEventListener('click', listener)
  }) 
})
  Content-Type: application/x-www-form-urlencoded;charset=utf-8
  url/?title=test&name=Tom
const timeZoneOffset = -(new Date().getTimezoneOffset() / 60)
console.log(timeZoneOffset) // 8
  function toggleSetInterval(e) {
    const eventType = e.type
    // console.log(eventType)
    if (eventType === 'mouseenter') {
      // 滑鼠移入,移除計時器,關閉自動輪播效果
      window.clearInterval(carousel.autoLoopTimer)
    } else if (eventType === 'mouseleave') {
      // 滑鼠移出,重新掛載計時器,啟動自動輪播
      carousel.autoLoopTimer = setInterval(carousel.autoLoop, 3000)
    }
  }
  function getRandom(min, max) {
    return Math.round(Math.random() * (max - min) + min);
  }
const parent = document.querySelector('.parent')
parent.addEventListener('click', test)
function test(e) {
  // e.target 指向觸發事件的元件  .child
  console.log('e.target',e.target);
  // e.currentTarget 指向掛載事件的元件 .parent
  console.log('e.currentTarget',e.currentTarget);
  // this 指向掛載事件的元件  .parent
  console.log('this',this);
}
// const sum = function(num1, num2, .....一堆){
const sum = function(...num) {
  // 將傳入的變數 組合成陣列
  console.log(num) // [1, 2, 3]
  return num.reduce(function (sum, el) { return sum + el },0)
}
console.log(sum(1, 2, 3)) // 6
  // 展開陣列
  let number = [1, 2, 3];
  console.log(Math.max(...number));  //  3
  console.log(...number);  // 1, 2, 3
HTML Attribute (由 HTML 定義、回傳值必為字串)
Attribute 初始化 DOM properties,初始化結束後即完成工作
DOM Property (由 DOM 定義、回傳值可為非字串)
最佳實踐: 推薦使用 property 速度較快
  <!-- 在value上給予值 等同於 初始化 DOM 中的 Property -->
  <input id="inputId" type="text" value="TOM">
  const input = document.querySelector('#inputId')
  input.addEventListener('keydown', test)
  function test(e) {
  
    // HTML Attribute 'TOM' (即初始化的值)
    console.log(input.getAttribute('value')); 
    // HTML Attribute JQ版 'TOM'
    console.log($('#inputId').attr('value'))
    
    // DOM Property '你輸入的文字' (則會依照輸入數據作更改)
    console.log(input.value);
    // DOM Property JQ版 '你輸入的文字'
    console.log($('#inputId').prop('value'))
  }
0.1 + 0.2 === 0.3 false
const num = 10
switch (num) {
  case (num > 5):
    console.log('num > 5')
    break
  case (num < 10):
    console.log('num > 10')
    break
  default:
    console.log('Default') // 執行此
    break
}
if (num > 5) {
  console.log('num > 5')
} else if (num < 10) {
  console.log('num < 10')
} else {
  console.log('Default')
}
console.time()
function test() {
  setTimeout(() => {
    console.timeEnd()
  }, 1000)
}
test()
    // 設定 local commit 模版
    git config --local commit.template 絕對路徑
    
    // Git 記憶帳號
    git config credential.helper store
    // 可設成 Cache
    git config --global credential.helper 'cache --timeout 7200'
    
    // Git remote 增刪
    git remote remove origin
    git remote add origin ~.git
較低者,只有較高者未設置才會生效
    // -l 列出清單 
    git config -l 
    
    // 設置參數
    // 重新設置某參數 --unset
    git config --global user.name 'RocMark'
    git config --global user.email 
    function changeTextById(elementId, changeVal) {
      let hasInnerText = (document.getElementsByTagName('body')[0].innerText !== undefined)
      let elem = document.getElementById(elementId)
      if (!hasInnerText) {
        elem.textContent = changeVal
      } else {
        elem.innerText = changeVal 
      }
    }
    const str = 'Hey Yo!'
    
    // substring 開始、"長度"、預設結束為字串長度 可省略
    const substring = str.substring(0, 3)
    const substringFull = str.substring(0)
    console.log(substring, substringFull)
    
    // subStr 開始、結束、預設結束為字串長度 可省略
    const substr = str.substr(0, 3) // Hey
    cosnt substrFull = str.substr(0) // Hey Yo!
    console.log(substr, substrFull)
    <!-- 一般設定,到該時間即過期 -->
    <meta http-equiv="expires" content="時間"> 
    
    <!-- 一般禁用方法 -->
    <meta http-equiv="cache-control" content="no-cache">
    
    <!-- 舊式寫法,加是為了相容性 -->
    <meta http-equiv="pragma" content="no-cache"> 
    
    <!-- 設定為立即過期 -->
    <meta http-equiv="expires" content="0"> 
C:\ProgramData\Microsoft\Windows\Start Menu\Programs