SETUP FOR TYPESCRIPT

This commit is contained in:
Kent C. Dodds
2019-08-14 15:59:11 -06:00
parent 650e66fe3f
commit e88f4ba7af

14
src/typescript-example.js Normal file
View File

@@ -0,0 +1,14 @@
function add(a, b) {
return a + b
}
function getFullName(user) {
const {
name: {first, middle, last},
} = user
return [first, middle, last].filter(Boolean).join('')
}
add(1, 'two')
getFullName({name: {first: 'Joe', midd1e: 'Bud', last: 'Matthews'}})