How do i format a javascript date object as a string? 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. What is it? 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.