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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -