This file contains 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 merge = function() { | |
var object = {}; | |
for( var i = 0; i < arguments.length; i++ ) { | |
for(var prop in arguments[i]) { | |
object[prop] = arguments[i][prop]; | |
} | |
} | |
return object; | |
} |
This file contains 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 x = (function IIFE(){ | |
return 'Hello I am IIFE'; | |
})(); | |
console.log(x) // will log Hello I am IIFE |
This file contains 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 arr = [ | |
"1", | |
"2", | |
"3", | |
"4", | |
"5" | |
]; | |
var str = arr.join(","); |
This file contains 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 arr = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]; | |
var arrCopy = [110, 120, 130, 140, 150, 160, 170, 180, 190, 200]; | |
var newArr = arr.concat(arrCopy); | |
console.log(newArr); | |
console.log(arr); | |
console.log(arrCopy); | |
// output | |
// [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200] | |
// [10, 20, 30, 40, 50, 60, 70, 80, 90, 100] |
This file contains 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
function getFirst (obj) { | |
var first = null; | |
for(var prop in obj) { | |
first = obj[prop]; | |
break; | |
} | |
return first; | |
} | |
var obj = { |
This file contains 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
<TextInput | |
placeholder="Your Placeholder" | |
onChangeText={(value) => this.setState({value})} | |
style={[newStyle]} | |
editable={true} | |
multiline={true} | |
value={value} | |
onContentSizeChange={(e) => this.updateSize(e.nativeEvent.contentSize.height)} | |
/> |
This file contains 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
import { | |
TextInput | |
} from 'react-native'; |
This file contains 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
this.state = { | |
value: '', | |
height: 40 | |
} |
This file contains 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
const {value, height} = this.state; |
OlderNewer