Skip to content

Instantly share code, notes, and snippets.

/***
* Dynamic Object properties using square brackets
*/
let beverage = 'Beer';
const myObj = {
a: 1,
b: 2,
c: 3,
food: 'cheese',
// 1. Shorten the console log
const log = console.log.bind(document)
log("does it work?")
log("yes")
log(5)
// 2. Merge two arrays into one
const array1 = ["One", "Two", "Three"]
const array2 = ["Four", "Five", "Six"]