Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Class
  2. New
  3. Context
  4. Return
  5. Callback
  6. Closure-functions inside of another function
  7. Session( temprory stores the data, that accessable from any routes, it is part of request)
  8. Redirect
  9. Render
  10. Asynch – not sequintial
  11. Synch – one at a time
  12. Node- allows us run JS outside of our browser
  13. Req.body – for form data
  14. Req.params- this for url data (if we want to grab «apple.com/cats/» for example cats we use req.params
  15. .find()
  16. .findOne()
  17. .create()
  18. api
  19. func(){
  20. func(){
  21. }}
  22.  
  23.  
  24. in JavaScript var x ='yes'
  25. in typeScript var x:string ='yes';
  26. var y:number =5;
  27.  
  28. this is how we define class in JavaScript
  29. function Human(age, name){
  30. this.name = name
  31. this.age = age}
  32. var ray = new Human(18,'Ray')
  33.  
  34. describing class in TypeScript
  35. class Human{
  36. (properties):
  37. age:number
  38. name:string these two can be defined in the constructor
  39. constructor (age: number, name:string){
  40. this.age = age,
  41. this.name = name
  42. }
  43.  
  44. functions:
  45. speak(){
  46. console.log('Something')
  47. }
  48.  
  49. var Ray:Human = new Human(18, 'Ray')
  50.  
  51. Example
  52. class QB {
  53. team:String,
  54. number:number,
  55. name:string,
  56. constructor(team, number, name){
  57. this.team=team,
  58. this.number=number,
  59. this.name=string
  60. }
  61. stateself(): void{
  62. console.log('i am a $(this.name) and i am playing for the $(this.team),
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement