Skip to content

Instantly share code, notes, and snippets.

@oliverloops
Created February 16, 2019 06:34
Show Gist options
  • Save oliverloops/90ec759594e444ee4a6d638f870f60e1 to your computer and use it in GitHub Desktop.
Save oliverloops/90ec759594e444ee4a6d638f870f60e1 to your computer and use it in GitHub Desktop.
interface App {
let age: number
let date: number
}
class Big {
name: string
job: string
constructor(val:string, val_2: string){
this.val = name
this.val_2 = job
}
}
function reader(data:App){
let show = document.querySelector('#block')
let all = new Big('oliver','dev.')
return show.innerHTML = `I'm ${all.name} and
I'm ${data.age} years old!`.concat(`I work as a ${all.job}`)
}
const sets = {age: 20, date:150698}
reader(sets)
@oliverloops
Copy link
Author

This is an example of Interface over a function using Class Atributtes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment