made with esnextbin
Created
March 24, 2017 14:35
-
-
Save Nek/6dd6eb58389190089efe3edc6b5ed8ab to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>ESNextbin Sketch</title> | |
| <!-- put additional styles and scripts here --> | |
| </head> | |
| <body> | |
| <div id="output"></div> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // write ES2015 code and import modules from npm | |
| // and then press "Execute" to run your program | |
| import ReactDOM from 'react-dom'; | |
| import React from 'react'; | |
| o1 = {a:1,b:2} | |
| o2 = {...o1, b: undefined} | |
| delete o2.b | |
| console.log(o2) | |
| c = null | |
| const first = ([head] = []) => head; | |
| console.log(first()); | |
| ReactDOM.render(<div>!!!</div>, document.getElementById('output')); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "esnextbin-sketch", | |
| "version": "0.0.0", | |
| "dependencies": { | |
| "react-dom": "15.4.2", | |
| "react": "15.4.2", | |
| "babel-runtime": "6.23.0" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray'); | |
| var _slicedToArray3 = _interopRequireDefault(_slicedToArray2); | |
| var _extends2 = require('babel-runtime/helpers/extends'); | |
| var _extends3 = _interopRequireDefault(_extends2); | |
| var _reactDom = require('react-dom'); | |
| var _reactDom2 = _interopRequireDefault(_reactDom); | |
| var _react = require('react'); | |
| var _react2 = _interopRequireDefault(_react); | |
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
| // write ES2015 code and import modules from npm | |
| // and then press "Execute" to run your program | |
| o1 = { a: 1, b: 2 }; | |
| o2 = (0, _extends3.default)({}, o1, { b: undefined }); | |
| delete o2.b; | |
| console.log(o2); | |
| c = null; | |
| var first = function first() { | |
| var _ref = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; | |
| var _ref2 = (0, _slicedToArray3.default)(_ref, 1); | |
| var head = _ref2[0]; | |
| return head; | |
| }; | |
| console.log(first()); | |
| _reactDom2.default.render(_react2.default.createElement( | |
| 'div', | |
| null, | |
| '!!!' | |
| ), document.getElementById('output')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment