当前位置:网站首页>JS use toString to distinguish between object and array
JS use toString to distinguish between object and array
2022-07-01 09:18:00 【su27_ 0101】
typeof confound with
typeof yes js Provided Used to determine the type of variable Reserved words
But for judgment Object And Array Will return to Object
That is to say, I can't distinguish
typeof [ ];//Object
typeof {};//Object
toString To distinguish between
utilize Object.prototype.toString The printed string distinguishes
Object.prototype.toString.call([]);//'[object Array]'
Object.prototype.toString.call({});//'[object Object]'
Other types can also be distinguished
Object.prototype.toString.call(arguemnts);//'[object Arrguments]'
边栏推荐
- LogBack
- 韦东山板子编译内核问题解决
- How to realize the usage of connecting multiple databases in idel
- 【pytorch】2.4 卷积函数 nn.conv2d
- 【pytorch】transforms. Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))
- nacos簡易實現負載均衡
- FAQ | FAQ for building applications for large screen devices
- 钓鱼识别app
- [ESP nanny level tutorial] crazy completion chapter - Case: gy906 infrared temperature measurement access card swiping system based on the Internet of things
- MapReduce编程基础
猜你喜欢

Jetson Nano 安装TensorFlow GPU及问题解决

集成积木报表报错 org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
![[interview brush 101] linked list](/img/52/d159bc66c0dbc44c1282a96cf6b2fd.png)
[interview brush 101] linked list
![[video game training] real topic of 2013 video game of infrared optical communication device](/img/ef/c2c45c1c6c24aed0a4e93101047372.png)
[video game training] real topic of 2013 video game of infrared optical communication device

js作用域链与闭包

【检测技术课案】简易数显电子秤的设计与制作

小鸟识别APP

How to manage fixed assets well? Easy to point and move to provide intelligent solutions

MySQL optimization

Vsync+ triple cache mechanism +choreographer
随机推荐
NoSQL数据库的安装和使用
The fixed assets management system enables enterprises to dynamically master assets
Implementation and application of queue
OSPF - virtual link details (including configuration commands)
小鸟识别APP
Why is the Ltd independent station a Web3.0 website!
Pain points and solutions of equipment management in large factories
Error org apache. catalina. core. StandardContext. FilterStart start filter exception
JS variable lifting
Shell script -for loop and for int loop
MT7628K eCos开发入门
pcl_viewer命令
Structure de l'arbre - - - arbre binaire 2 traversée non récursive
钓鱼识别app
Leetcode daily question brushing record --540 A single element in an ordered array
How to realize the usage of connecting multiple databases in idel
2.3 [pytorch] data preprocessing torchvision datasets. ImageFolder
2.3 【kaggle数据集 - dog breed 举例】数据预处理、重写Dataset、DataLoader读取数据
[pytorch learning] torch device
[interview brush 101] linked list