Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class
- New
- Context
- Return
- Callback
- Closure-functions inside of another function
- Session( temprory stores the data, that accessable from any routes, it is part of request)
- Redirect
- Render
- Asynch – not sequintial
- Synch – one at a time
- Node- allows us run JS outside of our browser
- Req.body – for form data
- Req.params- this for url data (if we want to grab «apple.com/cats/» for example cats we use req.params
- .find()
- .findOne()
- .create()
- api
- func(){
- func(){
- }}
- in JavaScript var x ='yes'
- in typeScript var x:string ='yes';
- var y:number =5;
- this is how we define class in JavaScript
- function Human(age, name){
- this.name = name
- this.age = age}
- var ray = new Human(18,'Ray')
- describing class in TypeScript
- class Human{
- (properties):
- age:number
- name:string these two can be defined in the constructor
- constructor (age: number, name:string){
- this.age = age,
- this.name = name
- }
- functions:
- speak(){
- console.log('Something')
- }
- var Ray:Human = new Human(18, 'Ray')
- Example
- class QB {
- team:String,
- number:number,
- name:string,
- constructor(team, number, name){
- this.team=team,
- this.number=number,
- this.name=string
- }
- stateself(): void{
- console.log('i am a $(this.name) and i am playing for the $(this.team),
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement