JS 基礎知識點及常考面試題(一)

2022-07-07 23:57:22 字數 545 閱讀 3718

分為6個基本型別

number,string,boolean,null,undefine,symble

陣列,物件,函式

typeof

基本型別

typeof出了null,判斷為object,其他均能正確判斷

引用型別

函式判斷為function,其他均為object

instanceof

內部機制主要是通過原型鏈來判斷的

`const person = function() {}

const p1 = new person()

p1 instanceof person // true

var str = 'hello world'

str instanceof string // false

var str1 = new string('hello world')

str1 instanceof string // true

`轉boolean

物件轉原始型別

四則運算符

比較運算子

JS基礎知識點與常考面試題(一)

涉及面試題 原始型別有哪些?null是物件嗎?在js中原始的型別有6種,string number boolean null undefined symbol es6 首先原始型別儲存的值都是值,是沒有函式可以呼叫的,如undefined.tostring 此時可能會有乙個疑問,123 tostri...

js基礎知識點及常考知識點 一

涉及面試題 原始型別有哪幾種?null 是物件嘛?在js中,存在著6中原始值,分別是 typeof string function typeof string undefined typeof string string 除了會在必要的情況下強轉型別以外,原始型別還有一些坑。最為明顯的就是js的0....

Linux面試常考知識點

同步 非同步 阻塞與非阻塞 推薦 linux 五種io模型 詳解 linux下五種io模型 關於select poll epoll詳細介紹 分析 select poll epoll 推薦 linux 下i o多路復用區別與優缺點 select poll epoll區別 附 linux多程序程式設計中...