I have studied Javascript for a litte while now but I can't seem how to spot the difference if a statement is a function or constructor. This is the code for a Constructor:
function Book (pages, author) {
this.pages = pages;
this.author = author;
}
And this is a simple function:
var cars = function(printCar){
console.log(blabla);
};
However I have seen in serveral tutorials(i.e CodeCademy) that they are using the constructor syntax for making functions aswell. How is this possible?