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
Assuming you have JAVA and the SDK installed and... | |
you are wanting to test stuff using Android Emulator on MAC here are a few key commands and steps to get it going. | |
List Android Virtual Devices | |
$ => android list | |
Create Android Virtual Device | |
$ => android create avd -n myDroid-4.4.2 -t android-19 --abi default/x86 |
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 constructor : the last paramater is the function logic, everything before it is a paramater | |
var theConstructor = new Function('x', 'y', 'return x + y'); | |
// function statement | |
function theStatement(x, y) { | |
return x + y | |
}; | |
// function expression | |
var theExpression = function(x, y) { |
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
// functions are invoked using four different scenarios or patterns | |
/* | |
1. As a function | |
2. As a method | |
3. As a constructor | |
*/ | |
// function pattern | |
var myFunction = function(){ | |
return 'foo'; |
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
// predefined JavaScript functions | |
decodeURI() | |
decodeURIComponent() | |
encodeURI() | |
encodeURIComponent() | |
eval() | |
isFinite() | |
isNan() | |
parseFloat() |
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 manny = { | |
name: "Mannuel Ferreira", | |
age: 32 | |
}; |
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 manny = new Object(); | |
manny.name = "Mannuel Ferreira"; | |
manny.age = 32; | |
manny.profession = "Web developer"; |
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 bob = { | |
firstName: "Bob", | |
lastName: "Jones", | |
phoneNumber: "(650) 777-7777", | |
email: "bob.jones@example.com" | |
}; | |
var mary = { | |
firstName: "Mary", | |
lastName: "Johnson", |
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 nyc = { | |
fullName: "New York City", | |
mayor: "Bill de Blasio", | |
population: 8000000, | |
boroughs: 5 | |
}; | |
for ( var property in nyc ) { | |
console.log(property); | |
} |
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 suitcase = { | |
shirt: "Hawaiian" | |
}; | |
if(suitcase.hasOwnProperty("shorts")){ | |
console.log(suitcase.shorts); | |
} | |
else { | |
suitcase.shorts = "Denim"; | |
console.log(suitcase.shorts); |
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 nyc = { | |
fullName: "New York City", | |
mayor: "Bill de Blasio", | |
population: 8000000, | |
boroughs: 5 | |
}; | |
// write a for-in loop to print the value of nyc's properties | |
for(var x in nyc) { | |
console.log(nyc[x]); |
OlderNewer