javascript - return alert from function -


Please tell me why this does not work.

If I call SA then why not by the alert show?

  var s = {a: function () {warning ("test a"); }, B: function () {warning ("test b"); }}; S.à;   

Thanks

Try

  SA ();   

A is a function if you just type s.A; If you are saying, the code you are doing is what the reference is, A , e.g. If I have Chrome in the Java Works console sA; I get the following: chrome screenshot

Attention How was the output defined in the function definition?

Now, if I say 'SA'; What I originally expected - removes this function:

Enter the image details here Do

Comments