New York To Richmond By Train: 5 Reasons To Skip The Flight And Enjoy The Ride

I was searching on this link before finding this answer.

I did not find the solution in the link because i was looking for newline or new line instead of line feed.

New York To Richmond By Train: 5 Reasons To Skip The Flight And Enjoy The Ride 2

The new keyword in javascript can be quite confusing when it is first encountered, as people tend to think that javascript is not an object-oriented programming language.

New York To Richmond By Train: 5 Reasons To Skip The Flight And Enjoy The Ride 3

What is it?

New is always used to allocate dynamic memory, which then has to be freed.

By doing the first option, that memory will be automagically freed when scope is lost.

New York To Richmond By Train: 5 Reasons To Skip The Flight And Enjoy The Ride 6