function in the global namespace in javascript -


i have function in global namespace in js.

function test() {    console.log(this); } 

what ways call function? how call functions?

as peter aron mentioned possible ways of calling function. since interview question probable way of calling can include calling in html on event.

for example. onclick event add onclick="test()" element call function on on click event. can called on other applicable event element. can called / coupled jquery events well.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

ios - How to Rectify the Relationship Fault in CoreData While parsing RESTKIT? -