Last active
September 27, 2017 12:04
-
-
Save lazyTai/34bff5c048fbdbdd15f5f5ce12b78753 to your computer and use it in GitHub Desktop.
es6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save-dev babel-plugin-transform-decorators | |
{ | |
"plugins": ["transform-decorators"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cc=console; | |
// var a=[{key:0,name:'apple'},{key:1,name:'banana'}]; | |
// a.pop() | |
// a.shift() | |
// a.unshift({key:3,name:'apple1'}) | |
// var indexItem=a.find((item)=>{return item.name=="apple"}) | |
// cc.log(indexItem.key) | |
/*a.map((item,index)=>{ | |
cc.log(item) | |
cc.log(index) | |
})*/ | |
/*slice begin,rang_length*/ | |
var fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']; | |
var citrus = fruits.slice(1, 3); | |
cc.log(citrus)//[ 'Orange', 'Lemon' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment