Some of the techniques I've used to learn languages quickly and thoroughly:
-
Shadowing
-
Scriptorium
-
Side-by-Side Reading
export function checkArrayElementsEquality (initialArray, comparedArray) { | |
if (!initialArray || !comparedArray) return false | |
if (initialArray.length !== comparedArray.length) return false | |
const superSet = {} | |
for (let i = 0; i < initialArray.length; i++) { | |
const element = initialArray[i] + typeof initialArray[i] | |
superSet[element] = 1 |
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
const AUTH_TOKEN = process.env.AUTH_TOKEN; | |
const API_URL = `https://cors-anywhere.herokuapp.com/https://crm.zoho.com/crm/private/xml/Leads/insertRecords?newFormat=1&authtoken=${AUTH_TOKEN}&scope=crmapi`; | |
const zoho = (answers, result) => { | |
const request = | |
`<Leads> | |
<row no="1"> | |
<FL val="Lead Source">Loans Only App</FL> | |
<FL val="Business Arm">Loans Only</FL> |
import React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import Hero from '../Hero/Hero'; | |
import { fetchAnswers } from '../../actions/answerActions'; | |
import css from './Blueprint.scss'; | |
import { copy } from './Blueprint.data.js'; | |
class Blueprint extends Component { |
const num = parseInt(process.argv[2], 10); | |
const newBit = parseInt(process.argv[3], 2); | |
const thirdBit = num => { | |
const binNum = num.toString(2); | |
const binNumArr = binNum.split(''); | |
binNumArr.splice(2, 1, newBit); | |
console.log(binNumArr); | |
return binNumArr | |
} |
// 1. Even or odd | |
function isEven(value){ | |
if (value % 2 == 0){ | |
return true; | |
} | |
else | |
return false; | |
} |
https://jsbin.com/waxopar/edit?js,output
https://jsbin.com/gozuvo/edit?js,output
http://jsbin.com/sojaca/7/edit?js,output
(for the last one, I needed to look at the solution. This is as far as I got: http://jsbin.com/sojaca/4/edit?js,output)