首页 > 编程知识 正文

javascript数据类型,javascript引用类型

时间:2023-05-04 11:24:58 阅读:285441 作者:3825

返回八种数据类型:

number typeof (1)function typeof (function(){})string typeof ("aaa")undefined typeof(a) // 没有定义的变量boolean typeof true // 或者falsebigint typeof 99999999n // 最新型数据 ,以n结尾的整型数据symbol typeof Symbol() // Symbol()创建不同的值object typeof([1]) // 数组,null,对象

代码:

<!DOCTYPE html><html lang="en"><head></head><body><script type="text/javascript">console.log(typeof (1));console.log(typeof (function(){}));console.log(typeof ("aaa"));console.log(typeof(a));console.log(typeof true);console.log(typeof 999999n);console.log(typeof Symbol());console.log(typeof []);</script></body></html>

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。