const newList = [1, 2, 3, 4, 5]
const list = [4, 5, 6, 7, 8]
const endIndex = newList.findIndex(item => item === list[0]) // -> 3
const diff = newList.slice(0, endIndex === -1 ? undefined : endIndex)
console.log([...diff, ...list]) // -> [1, 2, 3, 4, 5, 6, 7, 8]
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
import React from 'react'; | |
import { Provider, connect } from 'react-redux'; | |
import { reduxifyNavigator } from 'react-navigation-redux-helpers'; | |
import pageNation from './pageNation'; | |
import { configureStore } from './Store'; | |
const store = configureStore(); | |
const mapStateToProps = (state) => ({ | |
state: state.nav, |
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
~$f10:: | |
While GetKeyState("f10", "P"){ | |
Send {a} | |
Send {d} | |
Sleep 0.01 ;milliseconds | |
} | |
return | |
f12:: |
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
{ | |
"item_type":"0", | |
"item_id":"1461952399", | |
"description":"", | |
"item_data":{ | |
"video_id":"sm28739739", | |
"title":"ใ็ฌฌ16ๅMMDๆฏExใใใใซใปใชใใป็ด ้ญ้คจโ กๅ็ทจ", | |
"thumbnail_url":"http://tn.smilevideo.jp/smile?i=28739739", | |
"first_retrieve":1461953251, | |
"update_time":1521939540, |
og24715/ABRepeatForYouTube ใไฝใใซๅฝใใ create-react-app ใไฝฟใใใซ React ใขใใชไฝใใฎใฉใใใฃใใฃใใใชใฃใใฎใง Webpack ใไฝฟใฃใๆๅฐๆงๆใใกใพใกใพๆธใใ
$ yarn add react react-dom
$ yarn add -D babel @babel/core @babel/preset-env @babel/preset-react @babel/preset-stage-0 babel-loader webpack webpack-command
const path = require('path');
ใใ่ฆใชใใใใฃใฆใฟใ
How to build a Chrome Extension with React JS โ Code == Life
popup/index.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
render() { | |
return ( | |
{React.Children.map( | |
this.props.children, | |
(child, index) => { | |
switch (typeof child) { | |
case 'string': | |
return child | |
case 'object': |