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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -