2
votes
4answers
601 views

Returning multiple values in Javascript

Often I am writing a function that returns multiple values, such as a pair of coordinates: function get_coords() { return ???; } If I was using a language like Python, I would use a tuple: ...
1
vote
1answer
75 views

create function of object prototype

I am reading "Javascript : The good Parts" to improve my Javascript bases and knowledge. I was reading stuff about prototype and I encountered in this function : var stooge = { ... } if(typeof ...
5
votes
1answer
159 views

Is it called an instance in Javascript?

Say I have a function. function foo(){ //do stuff } And then I create an object of that function. var fooObj = new foo(); What is fooObj called? An instance, An object instance, or something ...
1
vote
1answer
187 views

javascript - would you consider 'prototype' to be the same as 'parent'

I'm learning javascript. I see that with an object, I can use .prototype, is it fair to say that, in a class/tree hierarchy I am effectively using the 'parent' (or 'ancestor' perhaps) by doing that? ...