Skip to content

Instantly share code, notes, and snippets.

@alihammad-gist
Last active September 4, 2015 22:35
Show Gist options
  • Save alihammad-gist/74b368ade23eee512e18 to your computer and use it in GitHub Desktop.
Save alihammad-gist/74b368ade23eee512e18 to your computer and use it in GitHub Desktop.
type ItemValue = string | number
interface Item {
[key: string]: ItemValue | Data
}
type Data = Item[]
function takeData(d: Data) {
for (var i = 0; i < d.length; i++) {
var c = d[i]['abc'];
if (typeof c !== 'string' && typeof c !== 'number') {
takeData(c);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment