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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Bittitan</title> | |
</head> | |
<body> | |
<noscript> | |
You need to enable JavaScript to run this app. |
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
"use strict"; | |
const tree = { | |
left: null, | |
right: null, | |
parent: null, | |
value: '0', | |
}; | |
const node1 = { |
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
function isMultipleOf(input, number) { | |
if (input % number === 0) { | |
return Promise.resolve(input); | |
} | |
return Promise.reject(new Error(`not a multiple ${input}`)); | |
} | |
isMultipleOf(20, 10).then(console.log, console.error) |
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
{ | |
React.cloneElement(props.children, { props1: propsValue }); | |
} |
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 { compose, createStore, applyMiddleware } from 'redux'; | |
import { Provider } from 'react-redux'; | |
import thunkMiddleware from 'redux-thunk'; | |
const middlewares = [ | |
thunkMiddleware, | |
]; | |
if (process.env.NODE_ENV !== 'production') { | |
const createLogger = require('redux-logger'); |
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
function solution(A) { | |
let longest = []; | |
let uniqueList = []; | |
let lengthList = []; | |
if (!Array.isArray(A) || A.length === 0) { | |
return 0; | |
} | |
for (let i = 0; i < A.length; i++) { |
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
let integerLists = [1,2,3]; | |
Array.prototype.multiply = function (callback) { | |
let list = []; | |
for(let i= 0; i < this.length; i++) { | |
list.push(callback(this[i], i)); | |
} | |
return list; | |
}; |
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
function init() { | |
var a = []; | |
function airPlane(val) { | |
a.push(val); | |
return a; | |
} | |
return airPlane; | |
} | |
var airPlane = init(); |
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
function titleCase(str) { | |
return str.toLowerCase().split(' ').map((word) => `${word[0].toUpperCase() + word.slice(1)}` ).join(' '); | |
} | |
titleCase("hEllo wORld"); // "Hello World" |
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
function divideByMinus (a, b) { | |
var i = 0; | |
while(a >= b) { | |
i++; | |
a = a - b; | |
} | |
return i; | |
} |