why does the URLSearchParams iterator skip every other k,v pair
Consider the following simple function with a URLSearchParams iterator. const foo = (qs) => { const sp = new URLSearchParams(qs); console.log(`pre: ${sp}`); for (const [key, val] of sp.entries()) { console.log(`’${key}: ${val}’`); sp.delete(key); } console.log(`post: ${sp}`); } foo(‘a=1&b=2&c=3&d=4’); With the sp.delete(key) line commented out, it prints pre: a=1&b=2&c=3&d=4 ‘a: 1’ ‘b: 2’ ‘c: 3’ ‘d: 4’… Read More why does the URLSearchParams iterator skip every other k,v pair