Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. let foo: {
  2. readonly bar: number;
  3. } = {
  4. bar: 123
  5. };
  6.  
  7. function iMutateFoo(foo: { bar: number }) {
  8. foo.bar = 456;
  9. }
  10.  
  11. iMutateFoo(foo); // The foo argument is aliased by the foo parameter
  12. console.log(foo.bar); // 456!```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement