Wednesday, July 20, 2016

example of call setting context

x = {name:"george",children:[{name:"herby",age:46},{name:"herby2",age:47} ,{name:"herby6",age:45} ]}
test = function(){
for (i = 0; i < this.children.length; i++) {
    console.log("Name:" + this.children[i].name + " age:" + this.children[i].age);
}
}
test.call(x);

 Name:herby age:46
 Name:herby2 age:47
 Name:herby6 age:45


btw - what is output when the data is thus
{name:"george",children:[{name:"herby",age:46},{name:"herby",age:46} ,{name:"herby",age:46} ]}

multiple lines in console

shift + enter

Simple example of closure


s= function(r){
i=89;
return function(){
return i * r;
}
}
s(10)();

Wednesday, July 6, 2016

reset certificates for fiddler

since i cleared the cache I get all sorts of errors so I needed to do this