JS判断类型方法总结

判断是否为字符串

typeof(res) == 'string'

判断是否为对象

Object.prototype.toString.call(res) === '[object Object]'
发布了121 篇原创文章 · 获赞 13 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/Vansal/article/details/100191255
今日推荐