Find error

Report a typo

What's wrong with this code?

const { decode } = require('node:querystring');

const url = 'https://hey-awesome-ninjas.com/team?turtle1=leo&turtle2=donatello&turtle3=michelangelo&turtle4=raphael';

const queryObj = decode(url.split('?')[1]);

if (queryObj.hasOwnProperty('turtle1')) {
    console.log('Leo is here');
} else {
    console.log('Leo is out to get some pizza');
};
Select one option from the list
___

Create a free account to access the full topic