> -----Original Message-----
> From: Pier Bover <[email protected]>
> Sent: Monday, March 19, 2018 5:06 PM
> To: Isiah Meadows <[email protected]>
> Cc: Ron Buckton <[email protected]>; es-discuss <es-
> [email protected]>
> Subject: Re: Pointers
>
> So the proposal is basically having references to primitives like strings,
> bools,
> etc?
If you are talking about my proposal, then no. References wouldn't be limited
to primitives, for example:
```js
function tryGet(map, key, ref value) {
if (map.has(key)) {
value = map.get(key);
return true;
}
value = undefined;
return false;
}
const map = new Map();
map.set("a", { x: 1 });
let value;
console.log(tryGet(map, "a", ref value), value); // true { x: 1 }
console.log(tryGet(map, "b", ref value), value); // false undefined
```
Ron
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss