Skip to content

[ JS201 ] - 課堂筆記 #17

@zuppachu

Description

@zuppachu

七種資料型態

primitive types 原始型態 (immuable 不能改變)

  1. null
  2. undefined
  3. string
  4. number
  5. boolean
  6. symbol(ES6)

其他的都是屬於

  1. object 物件,如:arry、function、date...

用來測驗為哪種屬性,可用 ?

  • typeof
    其中最為知名的 bug 是
    typeof null === object 但是不能更改,因為牽一髮動全身

  • console.log(Array.isArry([]))
    typeof 無法測 array,可改用上面寫法

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions