View Full Version : java script question

08-30-2010, 05:24 AM

if you are deleting this thread please let me know in which section of javascript programming should i post this question

i have been going through the tutorial section in http://www.javascriptkit.com/javatutors/

i went throught this article "Adding properties to a literal in JavaScript". The page is http://www.javascriptkit.com/javatutors/proplit.shtml. i have executed the script which is given at the end of the page i.e

y = "JavaScript"
function myFunc2(obj) {
obj = new obj.constructor(obj)
obj.myProp = new Object()
// returns [object Object] when calling myFunc2(y)

my question is:
i wish to know how will i get the value that is there in the variable y because the last statement
displays "object object" in the message box.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum