In the future, it will help me and others in this alias to answer
your question better if you
post a single question per email preferably with text and attached
images.
I will try to answer the first question. And if you can post the
second question
as I suggested above, that will be appreciated
- The scope of a variable is only relevant regarding a function
- In JavaScript, an object is defined as key value pairs
- The following is a valid syntax as an object
var
hash_fnc = {
a : 10,
b : 15,
c : function add(a, b){
console.log(a+b);
}
}
-But the following is not a valid syntax because
you cannot use var inside an object, you use it
inside a function.
var
hash_fnc = {
var a : 10,
b : 15,
c : function add(a, b){
console.log(a+b);
}
}
--
-------------------------------------------------------------------
Sang Shin, sangshi...@gmail.com
http://www.linkedin.com/in/javapassion (Linkedin)
http://twitter.com/javapassion (Tweeter)
Life is worth living... with Passion!
----------------------------------------------------------------------