Created
February 16, 2019 06:34
-
-
Save oliverloops/90ec759594e444ee4a6d638f870f60e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an example of Interface over a function using Class Atributtes.