This file contains 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
Object.prototype.testFunc = function () { | |
console.log('I am test from of global ') | |
} | |
function Person(name, age) { | |
this.name = name; | |
this.age = age; | |
this.printIdentity = function() { | |
return 'Mr. ' + this.name; |
This file contains 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 ReactDOM from "react-dom"; | |
import "./styles.css"; | |
const App = props => { | |
const { name, age, classes, passedProps } = props; | |
return ( | |
<div className="App"> | |
<h4>Name: {name}</h4> |
This file contains 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
const quotes = ["quote1", "quote2", "quote3", "quote4", "quote5"]; | |
class NotFound extends React.PureComponent { | |
render() { | |
let randomQuote = quotes[Math.floor(Math.random() * quotes.length)]; | |
return ( | |
<h1> | |
Quote: <strong>{randomQuote}</strong> | |
</h1> | |
); |
This file contains 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
const quotes = ["quote1", "quote2", "quote3", "quote4", "quote5"]; | |
const NotFound = () => { | |
let randomQuote = quotes[Math.floor(Math.random() * quotes.length)]; | |
return ( | |
<h1> | |
Quote: <strong>{randomQuote}</strong> | |
</h1> | |
); | |
}; |
This file contains 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 { put, call, takeEvery} from 'redux-saga/effects'; | |
import { fetchMoviesApi} from './moviesApi'; | |
export function* fetchMoviesSaga(action) { | |
yield put({type: 'TOGGLE_LOADING', payload: true}); | |
try { | |
const movies = yield call(fetchMoviesApi); | |
yield put({type: 'TOGGLE_LOADING', payload: false}); | |
yield put({type: 'LOAD_INITIAL_MOVIES', payload: movies}); | |
} catch (e) { |
This file contains 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
http://rxmarbles.com/#combineLatest |
This file contains 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
async function testAsync() { | |
let response = await fetch('https://mock-wholesaleonline.getsandbox.com/testRedux'); | |
let result = await response.json(); | |
return result; | |
} | |
testAsync() | |
.then((result) => console.log(result)) | |
.catch((error) => console.log(error)) |
This file contains 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
function* generator(i) { | |
yield i; | |
yield i + 10; | |
} | |
var gen = generator(10); | |
console.log(gen.next().value); | |
// expected output: 10 |
This file contains 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
1. What is the difference between Object.create and new. | |
http://frontendnotes.net/what-the-difference-between-object-create-and-new-keyword/ | |
2. What is difference between context and scope. Thorough understanding of both. | |
3. What is react context. | |
4. What are the problems with higer order components. | |
5. How can you pass dynamic values as props, say dynamic refs to a multiple list items. | |
6. What are closures. | |
7. What is the problem with below code, how can you solve this. |
NewerOlder