Challenge 1
Access the global object without assuming a browser global name.
const root = globalThis;
Press Ctrl⌘Enter to check your answer
Practice the remaining standard global access and function APIs.
Challenge 1
const root = globalThis;
Press Ctrl⌘Enter to check your answer
Challenge 2
const value = "42";
console.log(isFinite(value));
Press Ctrl⌘Enter to check your answer
Challenge 3
const value = NaN;
console.log(Number.isNaN(value));
Press Ctrl⌘Enter to check your answer
Challenge 4
const value = parseInt("101", 2);
Press Ctrl⌘Enter to check your answer
Challenge 5
const value = parseFloat("12.5px");
Press Ctrl⌘Enter to check your answer
Challenge 6
const value = encodeURI("https://example.test/a path?q=hello world");
Press Ctrl⌘Enter to check your answer
Challenge 7
const value = encodeURIComponent("hello world&next=yes");
Press Ctrl⌘Enter to check your answer
Challenge 8
const value = decodeURIComponent("hello%20world%26next%3Dyes");
Press Ctrl⌘Enter to check your answer