What is Nostr?
Eric A. Meyer /
npub1dge…yw0u
2024-02-07 14:05:00

Eric A. Meyer on Nostr: I did this recently in JS and unusually, I’m sorry about it. Even given that I’m ...

I did this recently in JS and unusually, I’m sorry about it. Even given that I’m operating on an array and there can be occasional `undefined` (that is, missing array index) items, and I want to output a string result, surely there’s a better way to do this, right? Tell me.
```
let mask = [prevSet[a-1],prevSet[a],prevSet[a+1]].map((item)=>{ if(typeof item === 'undefined') return 0); else return item;}).join('');
```
Author Public Key
npub1dgewglf93wmf9u26ppwmmjmqa5uphv5jrtmtfkc3q7n754z3p8xqyayw0u