JSFiddle - React, Tailwind, and code Playground

by dmitri_pavlutin

JavaScript

const heroes = ['Batman', 'Superman'];
const villains = ['Joker', 'Bane'];

const all1 = heroes.concat(villains);
const all2 = [].concat(heroes, villains);

console.log(all1); // ['Batman', 'Superman', 'Joker', 'Bane']
console.log(all2); // ['Batman', 'Superman', 'Joker', 'Bane']