Guest User

Untitled

a guest
Apr 26th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. interface t {
  2. a: string,
  3. b: number,
  4. c: string
  5. }
  6.  
  7. let obj:t = {
  8. a: "foo",
  9. b: 12,
  10. c: "bar"
  11. }
  12.  
  13. function keepWholeObject(obj_param: {x: string, y:number}){
  14. let {a, b}:{a: string, b: number} = obj_param;
  15. console.log(`In function - ${a}`);
  16. console.log(`In function - ${b}`);
  17. }
  18.  
  19. function keepWholeObject(obj_param: { a: string, b: number }) {
  20. let { a, b }: { a: string, b: number } = obj_param;
  21. console.log(`In function - ${a}`);
  22. console.log(`In function - ${b}`);
  23. }
Add Comment
Please, Sign In to add comment