Question: what is the difference between object and function in javascript?
Answer: A function is an object, actually. In JavaScript, there are primitives (boolean, number, string, null, undefined), and then there are objects. So if something is not a primitive, it's an object. ... And from Wikipedia: Every function in JavaScript is an instance of the Function object.