Wednesday, July 25, 2012

javascript – Method, Functions and Objects



I have been doing code academy for the past few weeks and i am currently doing the object, function and method section on the Javascript Fundamentals (42%). I havent really skipped any bits as i really want to learn properly. However, i am having some problem understanding the use of functions, methods and objects.


I understand that an object is to store information such as real world info:



personObj=new Object();
personObj.firstname=\"John\";
personObj.lastname=\"Doe\";
personObj.age=30;
personObj.eyecolor=\"blue\";


Also, what exactly are constructors? and what does .this mean?


I also learnt to create a function, the way is



var whatever = new Function(){
then whatever here
}


but in code academy, they started coding with:



function whatever(){
Then Whatever
}


Whats the difference? I would love for someone to explain in the \”Javascript for Dummies\” type…


Thanks again!






Rating: 1 out of 5 based on 4 ratings



The post javascript – Method, Functions and Objects appeared first on Javascript ASK.






via Javascript ASK http://javascriptask.phpfogapp.com/javascript-method-functions-and-objects.html

No comments:

Post a Comment