Preview:
  const validKeys = new Set(newVariables.map(v => v.name)); // Extracts valid keys from newVariables
  return Object.fromEntries(Object.entries(prev).filter(([key]) => validKeys.has(key))); // Removes invalid keys
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter