❶ js里報錯Cannot read property 'zoom' of undefined
在讀取之前 沒看到d3在哪裡聲明賦值了所以d3為undefined d3.behavior也為undefined 因此,會報錯解決方法:在訪問該變數之前先聲明賦值