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
Post a Comment