Skip to content

Tag: concatenation

Displaying a concat array in an HTML element

I have multiple arrays that have been combined depending on user response. The only problem I have at this point is getting this final array to show up in the text field for the end user to see. Thanks for all the potential help! I have narrowed the problem to either the write function or the generate functio…

Concatenate Object values

I have a JavaScript Object and I’m sure the value of any key is an array (even empty in some case): Aside from using Underscore, is there any way to concatenate all the values of this Object (and create a new array)? At the moment I get the keys name using Object.keys, then I loop and concatenate. Any h…

Getting current date and time in JavaScript

I have a script that prints the current date and time in JavaScript, but the DATE is always wrong. Here is the code: It should print 18/04/2012 15:07:33 and prints 3/3/2012 15:07:33 Answer .getMonth() returns a zero-based number so to get the correct month you need to add 1, so calling .getMonth() in may will…