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 IndiaMart() { | |
let numbers = []; | |
let nodes = document.querySelectorAll('.pns_h'); | |
for(let i = 0; i < nodes.length; i++) { | |
numbers.push(nodes[i].innerHTML); | |
} | |
return numbers; | |
} | |
console.log(IndiaMart()); |
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
{ | |
"quotes": [ | |
{ | |
"quote": "Life isn’t about getting and having, it’s about giving and being.", | |
"author": "Kevin Kruse" | |
}, | |
{ | |
"quote": "Whatever the mind of man can conceive and believe, it can achieve.", | |
"author": "Napoleon Hill" | |
}, |
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
var form = document.getElementById("addForm"); | |
var taskList = document.getElementById("items"); | |
var input = document.getElementById("new_task"); | |
//Form add event | |
form.addEventListener("submit", addTask); | |
// Delete event | |
taskList.addEventListener("click", removeItem); |
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
'use strict'; | |
const denominationTypes = { | |
'PENNY': 0.01, | |
'NICKEL': 0.05, | |
'DIME': 0.1, | |
'QUARTER': 0.25, | |
'ONE': 1, | |
'FIVE': 5, | |
'TEN': 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
'use strict'; | |
const telephoneCheck = (str) => { | |
const validNumber = /^[1{1}]?[ ]?(\(\d{3}\)|\d{3})[- ]?(\d{3})[- ]?(\d{4})$/; | |
return validNumber.test(str); | |
} | |
console.log(`Test Case 01: " ${telephoneCheck("555-555-5555") === true}`); | |
console.log(`Test Case 02: " ${telephoneCheck("1 555-555-5555") === true}`); | |
console.log(`Test Case 03: " ${telephoneCheck("1 (555) 555-5555") === true}`); |
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
'use strict'; | |
const rot13 = (str) => { | |
const decrypted = [...str].map(c => { | |
let charCode = c.charCodeAt(0); | |
if (charCode >= 65 && charCode < 78) { | |
charCode += 13; | |
} | |
else if (charCode >= 78 && charCode <= 90) { | |
charCode -= 13; |
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
'use strict'; | |
const getRange = (num, list) => { | |
return [ | |
list.reduce((previous, current) => { | |
return (previous < num && num < current) ? previous : current; | |
}), | |
list.reduce((previous, current) => { | |
return (previous < num && num < current) ? current : previous; | |
}) |