SETUP FOR TYPESCRIPT
This commit is contained in:
14
src/typescript-example.js
Normal file
14
src/typescript-example.js
Normal 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'}})
|
||||||
Reference in New Issue
Block a user