例
const { hoge, ...props } = this.props;
...props
のとこで Parsing error: Unexpected token ...
になる
.esrintrc
"parserOptions": { "ecmaVersion": 6, "ecmaFeatures": { "experimentalObjectRestSpread": true } },
これで error 消える
牌語備忘録 -pygo
const { hoge, ...props } = this.props;
...props
のとこで Parsing error: Unexpected token ...
になる
"parserOptions": { "ecmaVersion": 6, "ecmaFeatures": { "experimentalObjectRestSpread": true } },
これで error 消える
(es5)
こういうURL で next
とかの値を取りたい
https://www.google.co.jp/?prev=next=http://foo.com&next=http://bar.com
function parseParameter(key) { var val = null; var params = []; var items = location.search.substr(1).split('&'); var i; for (i = 0; i < items.length; i++) { params = items[i].split('='); if (params[0] === key) { val = decodeURIComponent(params[1]); } } return val; }
url例
consoleで実行
> parseParameter('next') "http://bar.com"
こんな感じ?