zoukankan      html  css  js  c++  java
  • js basics

    refer to : https://www.udemy.com/course/the-web-developer-bootcamp/

    1. primitive types基本类型

    • the basic building blocks
      • Number
      • String
      • Boolean
      • Null
    • technically, there are two other primitive types, Symbol and BigInt

    Undefiend.  eg: youtube web page, 点赞数:number; 标题: string;是否订阅: boolean; 在console里面写js注释的时候,返回类型是undefined


    2. Numbes IN JS

    Js has one number type: positive numbers, negative numbers, whole numbers(integers), decimal numbers


    3. basic operations:addtion, substraction, multiplication, division.

    %  modulo.    remainder operator: check number is odd or even

    ** exponentiation    2**4 = 16.    two to the fourth power


     4. what is NAN?

    It is NOT A NUMBER.  eg: 0/0.   1 + NAN


    5. Variables & let

    basic syntax: let someName = value;   keywork: let


    6. clear().  to clear console


    7. const. const works just like let, except you can not change the value.

    why use const: to define some unchanged variables, const variables can not be reassigned.

    eg: const pi = 3.14159.  const daysInWeek = 7.  


     8.  camel-cased, with the first letter lowercased.


    9. In JS, the variables can be changed into another type, but in typescript, there are restrictions, you can not change the variables' type.


  • 相关阅读:
    初始JSON
    JS异步加载的三种方式
    JS之事件
    关于null == 0?返回false的问题
    JS之类型转换
    金融(一)
    使用var声明的变量 和 直接赋值并未声明的变量的区别
    POJ2594 Treasure Exploration
    POJ1422 Air Raid
    Codevs1922 骑士共存问题
  • 原文地址:https://www.cnblogs.com/LilyLiya/p/14244337.html
Copyright © 2011-2022 走看看