Type: Posts; User: onefootswill
Search took 0.02 seconds.
You guys totally rock! There has been some great explanations in there.
I think I have, once again, mixed up prototypal inheritance with pseudoclassical. Not in concept; but in implementation.
I'm struggling to get my head around prototypal inheritance. The example that I have been tinkering with is:
Ah. Right. Thanks. That definitely helps to fill in the picture for me.
So you can only use prototype if you use a function constructor to create the object.
As Crockford's method uses a...
Hi guys. Thanks very much.
Jeff. I was on the right track with your suggestions. Previously I had the following code:
// "person" written as a plain object
Thanks for that. However, I did not want to use the new operator when creating a Person object. I wanted to use Douglas Crockford's function:
I am struggling forward trying to understand some of the fundamentals of the language. I am getting an error with the following simple code:
Thanks rnd me.
Bit of a trick question. Window is the answer, which is neither Global or the object o. Although I think I read somewhere that window is the Global object where the host is a web...
I have a question about the following example from the book I am reading:
I have deduced from Firebug the the answer is global object. But I do not understand why.
Here is what I think....
Awesome. Thanks very much!
I think I understand the 2nd one now i.e. var v = v || 10;
What you effectively have is var v = undefined || 10 as v has not been assigned a value at all yet.
And undefined || 10...
I have a few conversion/cast questions. From a book I am reading:
At the console (firebug), why do the following give the results below
!!"false" results in true;
var v = v || 10; results in...
Cool thanks. I'll check it out tonight!
Thanks Guys. I'm more curious about how to do the equivalent using the prototype notation.
I moved the prototype statement outside of the constructor, but it complained about the this references.
I have a js file (objects.js) with a Person object and a student inheriting...
Thanks very much. That did the trick!
I have written the following small page and cannot figure out why it will not work. (It is meant to validate against empty input).
<!DOCTYPE html PUBLIC...