@OctavicSensei/

Typescript test (real!)

TypeScript

No description

fork
loading
Files
  • index.ts
  • MyClass.ts
  • package-lock.json
  • package.json
  • tsconfig.json
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import MyClass from './MyClass'
import * as _ from 'lodash'
import * as express from 'express'

const app = express()
const port = 8080

app.get('/', (req, res) => res.send('Hello World!'))
app.listen(port, () => console.log(`Example app listening on port ${port}!`))

const users: MyClass[] = ["A", "B", "C"].map(
  username => {
    return new MyClass(username)
  }
)

const result = _(users).map(user=>{
  return user.name
}).join(' & ')

console.log(result)