The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?
or
function myJsFunc() {
alert("myJsFunc");
}
<a href="javascript:…
What is the difference between using call and apply to invoke a function?
var func = function() {
alert('hello!');
};
func.apply(); vs func.call();
Are there performance differences between the two aforementioned methods? When is it best to use call …
What's the fastest way to count the number of keys/properties of an object? It it possible to do this without iterating over the object? i.e. without doing
var count = 0;
for (k in myobj) if (myobj.hasOwnProperty(k)) count++;
(…