Last active
November 1, 2017 20:49
-
-
Save nick123pig/41dda6b03a09c67ea48854975d04d668 to your computer and use it in GitHub Desktop.
mk
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
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 source = { | |
databases: { | |
foo: { | |
tables: { | |
a: 10, | |
b: 20, | |
c: 30, | |
}, | |
records: 100, | |
}, | |
bar: { | |
tables: { | |
d: 20, | |
e: 30, | |
f: 40, | |
}, | |
records: 100, | |
}, | |
baz: { | |
tables: { | |
g: 30, | |
h: 40, | |
i: 50, | |
}, | |
records: 100, | |
}, | |
} | |
}; | |
// array of objects {database: DATABASE_NAME, tables: SUM_OF_ALL_TABLES} | |
const destination = [ | |
{database: "foo", tables: 60}, | |
{database: "bar", tables: 90}, | |
{database: "baz", tables: 120} | |
]; | |
const transformFunction = (source) => { | |
// What would you do? | |
}; | |
console.log(transformFunction(source) === destination) |
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 isPalindrome = (string) => { | |
// What would you do? | |
}; | |
console.log(isPalindrome('racecar') === true); | |
console.log(isPalindrome('nascar') === false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment