Skip to content

Instantly share code, notes, and snippets.

@verytired
Last active September 1, 2015 04:31
Show Gist options
  • Save verytired/22e06bac9e73144f1bdc to your computer and use it in GitHub Desktop.
Save verytired/22e06bac9e73144f1bdc to your computer and use it in GitHub Desktop.
es6メモ

es6

import モジュール呼び出し

http://qiita.com/inuscript/items/41168a50904242005271 基本的なものだけ

import React from 'react'
↓
React = require(‘react')
import { Provider } from 'react-redux'
↓
 Provider =require('react-redux’).Provider
import {oof as foo} from "foo";
↓
var foo = require("foo").oof;

変数宣言 let

ブロックスコープ

//sample code
let x = 1;
if(true) {
    let x =2;
    console.log('x is '+ x);// x is 2
}
console.log('x is '+ x);// x is 1

ローカルとグローバルでスコープが違えば同じ変数名を使える 変数の保護が出来るようなもの

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment