1const Router = () => (
2 <BrowserRouter>
3 <div>
4 <Nav>
5 <NavLink exact={true} activeClassName='is-active' to='/'>Home</NavLink>
6 <NavLink activeClassName='is-active' to='/about'>About</NavLink>
7 </Nav>
8
9 <Match pattern='/' exactly component={Home} />
10 <Match pattern='/about' exactly component={About} />
11 <Miss component={NoMatch} />
12 </div>
13 </BrowserRouter>
14)
15
1var cars = ['mazda', 'honda', 'tesla'];
2var telsa=cars.pop(); //cars is now just mazda,honda
1<NavLink
2 to="/events/123"
3 isActive={(match, location) => {
4 if (!match) {
5 return false;
6 }
7
8 // only consider an event active if its event id is an odd number
9 const eventID = parseInt(match.params.eventID);
10 return !isNaN(eventID) && eventID % 2 === 1;
11 }}
12>
13 Event 123
14</NavLink>
15
13 types of JS Alerts
2
3 - Information : You can only accept.
4 - Confirmation: You can accept or decline.
5 - Prompt : You can accept, decline, and/or sendKeys.
6