Node.js - URL and Query String Handling
Identify the error in this code snippet that tries to add a query parameter:
const url = new URL('https://example.com');
url.searchParams.add('key', 'value');
console.log(url.href);