Skip to content

Instantly share code, notes, and snippets.

@mattbajorek
Last active April 10, 2020 02:04
Show Gist options
  • Save mattbajorek/52e657f85993613b545ede866d0541e8 to your computer and use it in GitHub Desktop.
Save mattbajorek/52e657f85993613b545ede866d0541e8 to your computer and use it in GitHub Desktop.
TypeScript generics example
Object.values(groupedNumberDataWithGeneric).forEach(numberArray => {
numberArray.forEach(num => {
console.log(num * 2);
});
});
Object.values(groupedStringDataWithGeneric).forEach(stringArray => {
stringArray.forEach(str => {
console.log(str.length);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment