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"]

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • 溫柔而堅定 文/菜包包 前段時間,偶然看到了樊登老師推薦的幾本育兒的書。讀完后我的育兒觀出現了翻天覆地的改變,我平...
    煙火文苑菜包包閱讀 646評論 0 1
  • 或許有一天我們終將老去。背歲月嘲笑的不成樣子,但回首過去時卻總是微笑著開始以淚落幕。往事,能留在回憶里的,能被記起...
    洛塵lc閱讀 250評論 0 2
  • Android 應用運行在 Java 虛擬機上,每打開一個 Android app 都會打開一個獨立的虛擬機。運行...
    xiaoyanger閱讀 931評論 2 14
  • 在寬闊的教室里坐著 慵懶的看著課本上的題 思緒卻還停留在兩天前 11月28號 莫大人的全國暢聊會 濟南站 去觀看暢...
    嗯我愛吃肉閱讀 250評論 0 0