Set up project:
mkdir project
cd project
npm init -y| syntax on | |
| set ruler " Show the line and column numbers of the cursor. | |
| set formatoptions+=o " Continue comment marker in new lines. | |
| set textwidth=0 " Hard-wrap long lines as you type them. | |
| set modeline " Enable modeline. | |
| set esckeys " Cursor keys in insert mode. | |
| set linespace=0 " Set line-spacing to minimum. | |
| set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) | |
| " More natural splits | |
| set splitbelow " Horizontal split below current. |
| import React, { Component } from 'react' | |
| class ElmComponent extends Component { | |
| shouldComponentUpdate(prevProps) { | |
| return false; | |
| } | |
| render() { | |
| return <div ref={this.initialize}/> | |
| } |
| // @remove-on-eject-begin | |
| /** | |
| * Copyright (c) 2015-present, Facebook, Inc. | |
| * | |
| * This source code is licensed under the MIT license found in the | |
| * LICENSE file in the root directory of this source tree. | |
| */ | |
| // @remove-on-eject-end | |
| 'use strict'; |
| import React, { Component } from 'react'; | |
| import logo from './logo.svg'; | |
| import Elm from 'react-elm-components' | |
| import { Buttons } from './components/elm/Buttons' | |
| import './App.css'; | |
| class App extends Component { | |
| render() { | |
| return ( | |
| <div className="App"> |
| // @remove-on-eject-begin | |
| /** | |
| * Copyright (c) 2015-present, Facebook, Inc. | |
| * | |
| * This source code is licensed under the MIT license found in the | |
| * LICENSE file in the root directory of this source tree. | |
| */ | |
| // @remove-on-eject-end | |
| 'use strict'; |
| var array = [1, 2, 3] | |
| var novoArray = [...array, 4, 5, 6] | |
| console.log(novoArray) //saída => [1, 2, 3, 4, 5, 6] |
| [a, b, ...rest] = [1, 2, 3, 4, 5]; | |
| console.log(a); // 1 | |
| console.log(b); // 2 | |
| console.log(rest); // [3, 4, 5] |
| ({a, b} = {a:1, b:2}) | |
| console.log(a) // 1 | |
| console.log(b) // 2 |