Skip to content

Instantly share code, notes, and snippets.

@ScottWhittaker
Created December 14, 2016 15:34
Show Gist options
  • Save ScottWhittaker/7d9e80913beb07fc3d5a5355ea29bafe to your computer and use it in GitHub Desktop.
Save ScottWhittaker/7d9e80913beb07fc3d5a5355ea29bafe to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
<style>
body {
font-family: sans-serif;
}
</style>
</head>
<body>
<!-- put markup and other contents here -->
<header>
<h1></h1>
</header>
</body>
</html>
// write ES2015 code and import modules from npm
// and then press "Execute" to run your program
import has from 'lodash/has';
const greeting = 'Hello ESNEXTBIN';
const h1 = document.querySelector('header h1');
h1.textContent = greeting;
const data = {a: {b: 2}};
console.log(has(data, 'a'));
console.log(has(data, 'x'));
console.log(has(data.a, 'b'));
{
"name": "esnextbin-sketch",
"version": "0.0.0",
"dependencies": {
"lodash": "4.17.2"
}
}
'use strict';
var _has = require('lodash/has');
var _has2 = _interopRequireDefault(_has);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var greeting = 'Hello ESNEXTBIN'; // write ES2015 code and import modules from npm
// and then press "Execute" to run your program
var h1 = document.querySelector('header h1');
h1.textContent = greeting;
var data = { a: { b: 2 } };
console.log((0, _has2.default)(data, 'a'));
console.log((0, _has2.default)(data, 'x'));
console.log((0, _has2.default)(data.a, 'b'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment