Call concat() on the first array, and pass each array to merge with it in as arguments. It returns a new array.
Miscellaneous
Add items to an array in JavaScript
Add items to an array. Pass the new items in as arguments.
Remove HTML/XML tags from a string
Use a regular expression to remove HTML/XML tags from a string.
Convert a string to a number
Sometimes it returns integer. Other times it returns a float. And if you pass in a string with random text in it, you’ll get NaN, an acronym for Not a Number.
Check if array has duplicates
Checks if there are duplicate values in a flat array. Use Set to get the unique values in the array.
Make a resizable element
First, we need to prepare some elements that indicate the element is resizable. They are placed absolutely at the four sides of the original element.
Make a draggable element
In order to make an element draggable, we need to handle three events.
Template Literals
Template literals provide a simpler way to create strings that span multiple lines or contain data.
Looping over an object’s keys and values
In this example you have access to each pair using the key and value variables during the loop.
Determine if a string contains a substring
String.indexOf() returns the index of where the substring starts in the string, or -1 if the substring isn’t found.