Met JavaScript

Web Set:

https://developer.mozilla.org/en-US/

1.DataType

Number;

String;

Boolean;

null(object);

undefined;

typeof : To find what the datatype of variables;

2.operators: + - * /;+= -= *= /=;++ --

Ternary operator    a == b ?  :

3.Array;

In javascript  objects have properties and methods;

Propeties are pieces of meta information about the object we can retrieve and use;

Methods are functions that belong to that object.

Array Function:

leng;  join();   push();  shift();  pop();  unshift();  reverse();  slice();

4.Functions

Functions are min programs inside our script.

Three Function:

named Functions: which are excuted when called by name;

anonymous functions: which typically run once they are triggered by a specific event.

Immediately invoked function expressions: which run the moment the browser encounters them.

5.BOM(Brower Object Model)

window.open();window.innerWith;window.outerWidth;

Window is the top-level object in the BOM, and it has a ton of properties and methods you can use to interact with

browser itself and what it displays.

DOM(Document Object Model) is the model of the document that forms the current webpage.

Document is one of the properties in the window object.which contains the current HTML document.

To get the document object you can call window.document.

document.querySelector()

document.querySelectorAll()

6.Adding New Dom Elements

A.create the element.

B.create the Text Node that goes inside the element.

C.Add the Text Node


**************importants*************

var c = 5 - "3" => c = 2

var a = 5, b = 5;  a==b is true; a === b  is false;

var color= ["blue","red"]; color.shift() => "blue"; color=["red"]

你可能感兴趣的:(Met JavaScript)