Skip to content

Instantly share code, notes, and snippets.

@alejandrorangel
Created June 3, 2016 21:06
Show Gist options
  • Save alejandrorangel/5d0516b553b6baf3e4f2ed1e3aa77bca to your computer and use it in GitHub Desktop.
Save alejandrorangel/5d0516b553b6baf3e4f2ed1e3aa77bca to your computer and use it in GitHub Desktop.
function(){
a;
b();
var a = ()=>{
console.log("Print #1");
}
function b(){
console.log("Print #2");
}
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
(()=>{
let mNumber = {
value:20
}
console.log(addValue(mNumber).value);
console.log(mNumber.value);
})();
function addValue(mNumber){
mNumber.value = 3;
return mNumber;
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
(()=>{
var mObject = {}
mObject.mArray = new Array(999999);
newArray = [];
for(let i = 0; i< mObject.mArray.length;i++){
newArray.push(mObject.mArray[i]);
}
console.log(newArray);
})();
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
function fibonacci (mValue){
if(mValue <2)
return 1;
else{
return fibonacci(mValue-2) + fibonacci(mValue -1);
}
}
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -
var name = "Mr G";
var last = "Test";
var myObject = {
name:"John",
last: "Doe",
personalData:{
name:"Juan",
last: "Corridos",
fullName: function () {
return this.name + " " + this.last;
}
}
}
var t = myObject.personalData.fullName;
console.log(t());
console.log(myObject.personalData.fullName());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment