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 test() { | |
let x = 5; | |
function closure() { | |
console.log( x ); | |
} | |
return closure; | |
} |
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
//Question 1 | |
function isIsogram(string) { | |
let nonIso = [] | |
let arry = string.toLowerCase().split(' ') | |
for (let i = 0; i < arry.length; i++) { | |
let word = arry[i].split('') | |
let hashTable = {} | |
for (j = 0; j < word.length; j++) { | |
if (!hashTable[word[j]]) { |
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
//Question 2 | |
//g makes it global and the \b keeps it to only words that have a boundry (space between). | |
function cocknify(input) { | |
return input.replace(/\bh/g, '\`') | |
} | |
// Question 3 | |
//refactored so the for loop doesnt have = to eliminating the need for the idx - 1 |
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 main() { | |
// provided by hackerrank | |
var a = readLine(); | |
var b = readLine(); | |
// split the input into an array | |
aArray = a.split('') | |
bArray = b.split('') | |
// declare a variable set equal to an empty object |
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 main() { | |
// provided by hackerrank. | |
var n_temp = readLine().split(' '); | |
var n = parseInt(n_temp[0]); | |
var k = parseInt(n_temp[1]); | |
a = readLine().split(' '); | |
a = a.map(Number); |
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 largestSet() { | |
// grabs the specific paragraph you mention in the job description and splits it into an array | |
// (including white spaces as per your example) and sets it equal to a variable. | |
let charArry = document.querySelector('#content > div > div > div > div.col-md-9 > div > p:nth-child(3)').innerText.split('') | |
// check to make sure the paragraph is long enough for what we are trying to achieve. In this | |
// scenario we know it's longer than 50, but if we want to reuse this fn later this check is necessary. | |
if (charArry.length < 100) { | |
return 'not possible w/o dropping below 50 in length' | |
} |
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 cocknify(input) { | |
// Couple things involving Regex: | |
// 1. The \b matches a word boundary (in other words where a word character is not | |
// followed or preceded by another word character). This will match only words | |
// that start with 'h' and not touch any internal h's. | |
// 2. The h is our search value. | |
// 3. The g makes the search global rather than just repalcing the first h it comes | |
// across and returning (keep in mind the \b stops it from effecting any internal h's). | |
// 4. The i makes it case in-sensitive so 'H' and 'h' are replaced. | |
// 5. Lastly, the backslash before the backtick is needed to escape the quotes. |
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
fetch('http://api.wynd-staging.com/v3/orders', { | |
method: 'GET', | |
headers: { | |
'Authorization': '{YOUR_JSON_TOKEN}' | |
} | |
}) |
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
$ brew update && brew cask install react-native-debugger |
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
$ yarn add redux-devtools-extension --dev |