Skip to content

Instantly share code, notes, and snippets.

@mchelen
Created October 22, 2018 17:21
Show Gist options
  • Save mchelen/5eb90a91d327c9236191ba6242e8ff13 to your computer and use it in GitHub Desktop.
Save mchelen/5eb90a91d327c9236191ba6242e8ff13 to your computer and use it in GitHub Desktop.
// source https://jsbin.com
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
//jshint esnext:true
const arr1 = [
'foo',
'bar',
];
const arr2 = [
'baz',
'fuzz',
];
const arrMerge = [ ...arr1, ...arr2 ];
console.log(arrMerge);
const obj1 = {a:1,b:2};
const obj2 = {c:3};
const objMerge = { ...obj1, ...obj2 };
console.log(objMerge);
</script>
<script id="jsbin-source-javascript" type="text/javascript">//jshint esnext:true
const arr1 = [
'foo',
'bar',
];
const arr2 = [
'baz',
'fuzz',
];
const arrMerge = [ ...arr1, ...arr2 ];
console.log(arrMerge);
const obj1 = {a:1,b:2};
const obj2 = {c:3};
const objMerge = { ...obj1, ...obj2 };
console.log(objMerge);
</script></body>
</html>
//jshint esnext:true
const arr1 = [
'foo',
'bar',
];
const arr2 = [
'baz',
'fuzz',
];
const arrMerge = [ ...arr1, ...arr2 ];
console.log(arrMerge);
const obj1 = {a:1,b:2};
const obj2 = {c:3};
const objMerge = { ...obj1, ...obj2 };
console.log(objMerge);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment