I've been reading a tutorial, and at one point, a method is declared like this:
this.addBook = new
Function("book","this.books.push(book)");
What this does is adding a book into the books array that that class has. However, I am more used to do it like:
this.addBook = new Function(book){
this.books.push(book);}.
So, my question is: Can a function parameter interact with the other parameters? As in this case, the second parameter is using the first parameter. Also, why the parameters are passed with " ", if book is an object (of the class Book) and not a string?
Thank you