Js
For … in. 返回对象所含元素索引,传言不靠谱
for(var i in a){console.log(i)}
For … of for(var i of a){console.log(i)}遍历返回元素
for(var i of a){console.log(i)}
a.forEach((value)=>{console.log(value)})遍历返回元素
a.map((v,k)=>{})遍历索引and值
React js
Create react app
npx create-react-app first_react
npx(execute) nom(management)
App 目录下可运行的指令

Component 特点 state, update
What is javascript?
文档地址:https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript
Apis
* The DOM (Document Object Model) API allows you to manipulate HTML and CSS, creating, removing and changing HTML, dynamically applying new styles to your page, etc. Every time you see a popup window appear on a page, or some new content displayed (as we saw above in our simple demo) for example, that's the DOM in action.
* The Geolocation API retrieves geographical information. This is how Google Maps is able to find your location and plot it on a map.
* The Canvas and WebGL APIs allow you to create animated 2D and 3D graphics. People are doing some amazing things using these web technologies —see Chrome Experiments and webglsamples.
* Audio and Video APIs like HTMLMediaElement and WebRTC allow you to do really interesting things with multimedia, such as play audio and video right in a web page, or grab video from your web camera and display it on someone else's computer (try our simple Snapshot demo to get the idea).
Js作用域
全局变量都存储在window对象中,
全局变量,具有以下特征之一为全局变量:
1、函数外定义;
2、函数内未声明;
3、全局变量全局内皆可调用;
局部变量特征:
1、只能作用于函数内;
2、定义与全局变量同名的局部变量不会覆盖;
3、局部变量仅在函数执行时创建,执行完成后局部变量自动销毁
4、函数外不可访问
块级作用域
1、指在if、switch、for等语句块中定义的变量,不能在块之外被访问
2、var 不支持块级作用域
3、为了解决块作用域,引入了let和const,可以声明块级作用域的变量
生命周期:
1、一旦定义,一直存在;
2、仅可在块内被访问。
this 指向对象
use strict 模式下,this默认为undefined,其他默认为window对象
函数被调用时,指向当前方法的实例化对象
变量作用域搜寻逻辑,当前环境往上
相关文章:
https://www.cnblogs.com/itjeff/p/10106855.html