如何在javascript中初始化特殊对象即接口?

时间:2019-06-22 01:37:08

标签: javascript object interface initialization

当我初始化诸如lkd> .crash NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\atlmfc.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\concurrency.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\cpp_rest.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\stl.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\Windows.Data.Json.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\Windows.Devices.Geolocation.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\Windows.Devices.Sensors.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\Windows.Media.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\windows.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\winrt.natvis' NatVis script unloaded from 'C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\Visualizers\Kernel.natvis' mylist1 = [[1,2,3], [4,5,6], [7,8,9]] for x in mylist1: for y in x: if y%2 == 0: print(y) Node等的某些类/接口时,出现错误:NodeList

例如:

  

HTMLCollection

未捕获的TypeError:非法构造函数
:1:9

  

Illegal Constructor;

未捕获的TypeError:非法构造函数
:1:9





问题1:为什么会发生此错误?

问题2:如何初始化此类对象?

问题3:为什么这些对象被命名为接口?尽管JavaScript中没有这样的关键字

问题4:关于这类对象/类,我还应该了解什么?

我希望,我对回答者提供了很多描述,也希望很快得到答案。

0 个答案:

没有答案