4 ms·
const result = data |> Object.entries(%) |> (%.filter(([k, v]) => v != null)) |> Object.fromEntries(%) |> Object.values(%) |> JSON.stri
by npodbielski 1y ago
const result = data
|> Object.entries(%)
|> (%.filter(([k, v]) => v != null))
|> Object.fromEntries(%)
|> Object.values(%)
|> JSON.stringify(%)
|> encodeURIComponent(%);
Looks kinda awful to me. Am I strange that I prefer the 'spaghetti' version?
- samhh 1y agoI’ll die on the hill that the tacit pipe operator would have been the right choice. IIRC the main objections came from engine implementors.