[object Object] ?

O

optimistx

I get this mysterious [object Object] now and then, and have thought that
ok, I understand.
But suddenly I do not understand. Why [], why small o, why capital O, what
is where
and why? Could somebody draw an image causing 'Aha!' ? Is there a deeper
meaning
in this, like 42?

(as a disobeying citizen, I have not read the FAQ thoroughly enough, and
have not
learnt ECMA-whatever, and have not changed the settings in my
computer/programs/
etc to appeal everyone, and have not learn to post, have not learnt to
quote,
and have not studied with google
first everything in the internet to find out the answer, and have not
respected the
feelings of law-and-order-people,
so anyone willing to punish me with an icy silence, pls go ahead :) .
)

And thanks for the friendly, willing-to-learn people over there. It has bee
a pleasure
to read your postings. Thanks for reading this.
 
O

optimistx

Jake said:
optimistx wrote: ... ....
You don't have to repeat that in every post you make, I would say.
Ok, I'll keep some pause in repeating this, perhaps I add a signature
with a link to the page with these rantings, and the opposite views :) .
That mysterious output looks like what Object.prototype.toString
should produce for a given value of `this`/`thisArg`:
When the toString method is called, the following steps are taken:
1. Get the [[Class]] property of this object.
2. Compute a string value by concatenating the three
strings "[object ", Result(1), and "]".
3. Return Result(2).
....
(unofficial) html version
http://interglacial.com/javascript_spec/a-15.html#a-15.2.4.2

You guessed right. Class? Class in a classless language? The kind of the
object is class?

The html-version with links is a treasure.
 
O

optimistx

Stefan Weiss wrote:
....
I'm not sure how to go about this. Normally I'd say this is explained
in the ECMAScript specification, and refer you to it, but since you
mentioned that you don't want to learn "ECMA-whatever"... (shrug). If
you want to understand the language, you'll have to bite the bullet
and read the specification sooner or later. Just my $0.02.


cheers,
stefan

Sorry being a bit too provocative.

Yes, in fact I might have read the specification in pdf-format 2-3 times,
but
understanding it thoroughly might take some more years. The pdf-file is
720 951 bytes, 188 pages, and I have found only one image (on page 3,
explaining new ).

I have felt angry and frustrated, when not finding good educational
material,
but differing opinions everywhere. The things I have learnt this far during
perhaps 2-3 manmonths of effective studying time could have been learnt in
one day
with good educational material with images diagrams etc to aid in
understanding and remembering

Many important facts have surfaced by chance.
I still have the feeling that I am not using the features of prototypal
language in the natural way. (opposite: classical class based language like
C++)

Crockford, whose pages I have been studying like Bible, admits having
been wrong when trying to use javascript like C++ (for those who
come from C++ world). And that after wasting so much time to learn that!

If one wants to learn how to find one's way in a new town, a map
gives you in some minutes more information than 720 951 bytes of
detailed verbal descriptions of the streets, houses, parks in hours.

Ok, I'll continue studying, 188 pages also :)
 
T

tcole6

42 ? What does that mean now?

Douglas Adams, Hitchhiker's Guide to the Galaxy. It's the answer to
the question of life, at which time they realized they needed another
computer to give them the question.

His Dirk Gently books were excellent as well.
 
B

Bruno Desthuilliers

tcole6 a écrit :
Douglas Adams, Hitchhiker's Guide to the Galaxy. It's the answer to
the question of life,

Actually, the question of "life, the universe and everything" IIRC.
 
T

Thomas 'PointedEars' Lahn

tcole6 said:
Douglas Adams, Hitchhiker's Guide to the Galaxy. It's the answer to
the question of life,

_The Ultimate Question of Life, the Universe, and Everything_ :)
at which time they realized they needed another
computer to give them the question.

<spoiler code="ROT-13">
Naq unq Rnegu abg orra va gur jnl bs gur arj Ulcrefcnpr Olcnff,
gur dhrfgvba jbhyq unir orra pbzchgrq ol abj ;-)
His Dirk Gently books were excellent as well.

Thanks, will look into it.


Regards,

PointedEars
 
O

optimistx

Stefan Weiss wrote:
....
I'm not sure how to go about this. Normally I'd say this is explained
in the ECMAScript specification, and refer you to it, but since you
mentioned that you don't want to learn "ECMA-whatever"... (shrug). If
you want to understand the language, you'll have to bite the bullet
and read the specification sooner or later. Just my $0.02.


cheers,
stefan

I am grateful about your advice (worth definitely more than $0.02) ,
and have been biting the bullet with ECMA-262.

For those visually oriented people who might learn best by using
images there are some sources which I have found very fascinating:

1) netbeans 6.7.1 'Navigator' shows a compact summary of a page or js code
like this
http://www.24.fi/optimistx/clj/images/fork.png

2) Herong Yang shows constructors, objects, prototypes using images,
which is easy to memorize

http://www.herongyang.com/JavaScript/Inheritance-Prototype-Object-Chain-Summary.html

3) David Flanagans book, 5th edition from the year 2006, is partly readable
in the
net also , http://books.google.com and keywords David Flanagan. Not many
pictures :(, but examples easy to understand). Almost 1000 pages...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top