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
// as per https://www.youtube.com/watch?v=XnyZXNnWAOA | |
interface Coordinate { | |
x: number; | |
y: number; | |
} | |
function parseCordinates(obj: Coordinate): Coordinate; | |
function parseCordinates(str: string): Coordinate; | |
function parseCordinates(num1: number, num2: number): Coordinate; |
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
/* | |
Write a function to flatten the following nested object to an array of objects. | |
Your function should be able to handle any level of nesting and it should have better performance. | |
Expected output ex: | |
[ | |
{title: 'Foo', value: 111}, | |
{title: 'Bar', value: 222}, | |
... |