Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let foo: {
- readonly bar: number;
- } = {
- bar: 123
- };
- function iMutateFoo(foo: { bar: number }) {
- foo.bar = 456;
- }
- iMutateFoo(foo); // The foo argument is aliased by the foo parameter
- console.log(foo.bar); // 456!```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement