Skip to content

Instantly share code, notes, and snippets.

@nick123pig
Last active November 1, 2017 20:49
Show Gist options
  • Save nick123pig/41dda6b03a09c67ea48854975d04d668 to your computer and use it in GitHub Desktop.
Save nick123pig/41dda6b03a09c67ea48854975d04d668 to your computer and use it in GitHub Desktop.
mk
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)
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