Join the Discussion
This is something that is not obvious to many people because the languages are very similar and code that you write to run as one will often run quite happily as the other. Occasionally though, one of the differences between these two languages will make a significant difference in how the code works.
var pm = 'PM';
var ampm = '';
The idea was to assign either the am or pm variable to the ampm variable depending on the time of day. This value was then put into a field on the web page using the following code: