SHARE
TWEET

Untitled

a guest Jul 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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!```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top