Using the Array.concat method

The Date constructor is the simplest and most straightforward way to get the current date and time in JavaScript. It’s a great option if you just need the current date and time and don’t need to do any further manipulation or formatting.   #checkifkeyexistsinobjectjavascript