-
跨平臺(Android+iOS) 性能高(獨立渲染js的引擎)動態更新
查看全部 -
傳統dom都是命令式渲染,
vue angular react 都是聲明式
查看全部 -
1. **是指數操作符
不使用指數操作符時:
function?calculateExponent(base,?exponent) { ????if?(exponent?===?1) ????{ ????????return?base; ????} ????else ????{ ????????return?base?*?calculateExponent(base,?exponent?-?1); ????} } console.log(calculateExponent(2,?10));?//?輸出1024 console.log(Math.pow(2,?10));?//?輸出1024
使用
2**10
等同
2. ES8的特性
async/await
Object.values()
Object.entries()
String padding
函數參數列表結尾允許逗號
Object.getOwnPropertyDescriptors()
好吧!await幾乎看不懂。
查看全部 -
Promise 是異步編程的一種解決方案,比傳統的解決方案callback更加的優雅。
看不懂,應該是個回調。
查看全部 -
延展操作符在react中的應用
const?params?=?{ name:?'Jine', age:?21 } <CustomComponent?{...params}?/>
等同于
<CustomComponent?name?='Jine'?age?={21}?/>
配合解構賦值避免傳入一些不需要的參數
var?params?=?{ name:?'123', title:?'456', type:?'aaa' } var?{?type,?...other?}?=?params; <CustomComponent?type='normal'?number={2}?{...other}?/> //等同于 <CustomComponent?type='normal'?number={2}?name='123'?title='456'?/>
查看全部 -
使用模板字符串進行字符串的拼接
var?name?=?`Your?name?is?${first}?${last}.`
在ES6中通過
${}
就可以完成字符串的拼接,只需要將變量放在大括號之中。2.?解構賦值語法是JavaScript的一種表達式,可以方便的從數組或者對象中快速提取值賦給定義的變量。
const?student?=?{ ??name:'Ming', ??age:'18', ??city:'Shanghai' }; const?{name,age,city}?=?student; console.log(name);?//?"Ming" console.log(age);?//?"18" console.log(city);?//?"Shanghai"
3.?延展操作符
const?stuendts?=?['Jine','Tom']; const?persons?=?['Tony',...?stuendts,'Aaron','Anna']; conslog.log(persions)//?["Tony",?"Jine",?"Tom",?"Aaron",?"Anna"]
var?arr1?=?[0,?1,?2]; var?arr2?=?[3,?4,?5]; var?arr3?=?[...arr1,?...arr2];//?將?arr2?中所有元素附加到?arr1?后面并返回 //等同于 var?arr4?=?arr1.concat(arr2);
查看全部 -
如果需要函數默認值,最好是寫明函數的默認值
function?foo(height?=?50,?color?=?'red') { ????//?... }
查看全部 -
這是啥,啥也看不懂???!
查看全部 -
js代碼可以直接在console里面編輯,并且運行,這真有點神奇!
直接在Console中定義一個類,直接可以new一個這個類的對象。
查看全部 -
子類的構造函數中,必須先進行父類的構造函數,如圖所示
查看全部 -
React native的調試工具
查看全部 -
通過expo來安裝純RN的工程
手機上安裝expo的APP
通過npm install -g expo-cli安裝腳手架
初始化一個工程expo init helloworld
cd helloworld & npm start
查看全部 -
1. 組件可以看成一個狀態機
查看全部 -
Windows平臺環境搭建需要安裝的工具:note.js;react native command line;Android Studio/XCode;
查看全部 -
開發安卓工程用到的工具:AndroidStudio(在安卓開發者平臺)
構建iOS工程用到的工具:XCode(只能安裝在Mac平臺上)
查看全部
舉報