Skip to content

扩展知识点

luics edited this page Nov 17, 2021 · 2 revisions

JS

  • Primitive types:
    • undefined : typeof instance === "undefined"
    • Boolean : typeof instance === "boolean"
    • Number : typeof instance === "number"
    • String : typeof instance === "string"
    • BigInt : typeof instance === "bigint"
    • Symbol : typeof instance === "symbol"
    • Object: typeof instance === "object"
      • Function: typeof instance === "function"
      • null : typeof instance === "object"
  • BigInt: arbitrary precision, 2n ** 53n === 9007199254740992n
  • String: immutable, use it as 'textual-data-only'
  • Symbol: unique identifier, Well-known Symbols(Symbol.hasInstance, Symbol.iterator)
  • Object: a collection of properties
    • key is String or Symbol, value can be any type
    • data property, accessor property
    • hashmap ~= object
    • Function, Array are also objects
  • Value Types and Reference Types,值类型和引用类型
  • Coercion: type convertion, too complex to avoid it! 3 * "3" = ?
  • == or ===, always use ===
    • 1 == "1", true, perform type coercion
    • 1 === "1", false
    • Falsy Values: false, 0, "", null, undefined, NaN

CSS

  • CSS is NOT a programming language. CSS is what you use to selectively style HTML elements.

    • p{color:red;},This CSS selects paragraph text, setting the color to red

    • 选择器(Selector),p
    • 规则(Decalration/Rule),color: red;
      • 属性(Property),或属性名,color
      • 属性值(Property value),red
  • Cascade & Specificity & Inheritance,级联、优先级和继承,CSS最核心的概念

    • 级联(Cascade):一个元素可以被多个选择器命中
    • 优先级(Specificity):级联状态下,如何确定命中的规则
    • 继承(Inheritance):无特定规则,跟着感觉走,如color可继承、width不可继承

文章&书

工具

Clone this wiki locally