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 allUnique(string) { | |
if (string.length !== (new Set(string)).size) { | |
console.log(`Duplicate characters, same case, in '${string}'`); | |
return false; | |
} else { | |
if (string.length !== (new Set(string.toLowerCase()).size)) { | |
console.log(`Duplicate characters across cases in '${string}'`); | |
return false; | |
} else { | |
console.log(`No duplication in '${string}'`); |
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 arr1 = [7, 4, 10, 0, 1]; | |
const arr2 = [9, 7, 2, 3, 6]; | |
const sortArr = (a, b) => {return b - a;}; | |
const maximisedArray = function (arr1, arr2) { | |
const n = arr1.length; | |
const combinedArr = arr1.concat(arr2); | |
const sortedArr = combinedArr.sort(sortArr); | |
const uniqueElements = [...new Set(sortedArr)]; | |
return uniqueElements.slice(0, n); | |
}; |
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
let receipts = [ | |
{ name: "Ximena", paid: 45 }, | |
{ name: "Clara", paid: 130 }, | |
{ name: "Ximena", paid: 100 }, | |
{ name: "Cassidy", paid: 140 }, | |
{ name: "Cassidy", paid: 76 }, | |
{ name: "Clara", paid: 29 }, | |
{ name: "Ximena", paid: 20 } | |
]; | |
function whoOwes(array) { |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Child page</title> | |
<!-- Stylesheet --> | |
<style type="text/css"> | |
body | |
{ |