JS >data type> cheatsheet

Agnes Shin·2022년 2월 4일
0

JavaScript>data type>cheatsheet

what is a data type?
data type is basically specifies what kind of data can be stored and manipulated with the program.

7 types of data types as listed below:

Primiative data types

  1. What are strings?
    Strings are a primitive data type. They are any grouping of characters surrounded by single quote ' or double quotes ".
    • letters
    • spaces
    • numbers
    • symbols
  2. What are numbers?
    Numbers are a primitive data type.
    They include the set of all integers and floating point numbers.
    examples)

    let amount = 6;
    let price = 4.99;

  3. What is a boolean?
    true or false
  4. What is the difference between null and undefined?
    Null is a primitive data type.
    It represents the intentional absence of value.
    It is represented as null.
    example)

    let x = null;

    Undefined is a primitive JavaScirpt value that represents lack of defined value.
    Variables that are declared but not initialized to a value will take the value undefined. example)
    var a;
    console.log(a);  // Output: undefined

===================== ... to be continued...

  1. What is an object?

  2. What is an array?

  3. What is a function?

profile
30기 신윤숙 / FE

0개의 댓글