main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
const unsafeOptions = {
  fontSize: 18
};
const defaults = {
  fontSize: 16,
  color: 'black'
};
const options = {
  ...defaults,
  ...unsafeOptions
};
console.log(options.fontSize); // => 18
console.log(options.color);    // => 'black'
Babel Compiler v6.4.4 Copyright (c) 2014-2015 Sebastian McKenzie