TypeOf the mistake of making the type judgment easily

Source: Internet
Author: User

Learn JS classmates know the data type JS has

String, number, Boolean, array, object, Null, Undefined

As a beginner I have always thought that the result of each data type return is this

typeof ("string")

String

typeof (111)

Number

typeof (True)

Boolean

typeof (Arr[])

Array

typeof (FN ())

function

typeof (NULL)

Null

typeof (Undefind)

Undefind

When I judge null and arr[] The result is this.
typeof (Arr[])

Object

typeof (NULL)

Object

Before the interview was asked I do not hesitate to answer the above results, and then test to find that the original is the following look of hope and JS small partners to do a mutual encouragement bar.

TypeOf the mistake of making the type judgment easily

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.