Questions
JavaScript questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Open a URL in a New Tab in JavaScript
Learn how JavaScript window.open works, why browsers may open a new window instead of a tab, and what developers can control.
How to Pass Command Line Arguments in Node.js
Learn how to pass and read command line arguments in Node.js using process.argv, with examples, common mistakes, and a mini project.
How to Pretty-Print JSON in JavaScript
Learn how to pretty-print JSON in JavaScript using JSON.stringify, indentation, formatting options, and display techniques for readable output.
How to Redirect to Another Webpage in JavaScript
Learn how to redirect users to another webpage using JavaScript, including location.href, replace(), and common redirect patterns.
How to Refresh a Page Using JavaScript
Learn how to refresh a page using JavaScript, including reload syntax, examples, use cases, mistakes, and a practical mini project.
How to Remove Duplicate Values from a JavaScript Array
Learn how to remove duplicate values from a JavaScript array using Set, filter, and loops with clear examples and common mistakes.
How to Remove Duplicates from a JavaScript Array
Learn how to get unique values from a JavaScript array, why older loops fail with 0, and the safest ways to remove duplicates.
How to Remove a Property from a JavaScript Object
Learn how to remove a property from a JavaScript object using delete and object rest syntax, with examples, mistakes, and use cases.
How to Remove a Specific Item from an Array in JavaScript
Learn how to remove a specific value from a JavaScript array using core methods like filter, splice, and indexOf with clear examples.
How to Replace All Occurrences of a String in JavaScript
Learn how to replace all occurrences of a substring in JavaScript using replaceAll, regular expressions, and safe patterns.
How to Return Values from Asynchronous Functions in JavaScript
Learn why async functions return undefined and how to use callbacks, Promises, and async/await correctly in JavaScript.
How to Round to At Most 2 Decimal Places in JavaScript
Learn how to round numbers to at most 2 decimal places in JavaScript without forcing unnecessary trailing zeros.
How to Scroll to an Element with jQuery Animation
Learn how to scroll to a specific element with jQuery using animate(), offset(), and click events with smooth beginner-friendly examples.
How to Select Child Elements from $(this) in jQuery
Learn how to get child elements from $(this) in jQuery, including .children(), .find(), click handlers, and common selector mistakes.
How to Set a Checkbox as Checked in jQuery
Learn how to check and uncheck checkboxes in jQuery using prop(), attr(), and selectors with clear examples and common mistakes.
How to Sort an Array of Objects by a String Property in JavaScript
Learn how to sort JavaScript arrays of objects by a string property using sort() and localeCompare() with clear examples.
How to Stop setInterval in JavaScript
Learn how to stop setInterval in JavaScript using clearInterval, events, and practical examples for timers and auto-refresh.
How to Store JavaScript Objects in localStorage and sessionStorage
Learn why localStorage stores strings only and how to save and retrieve JavaScript objects safely with JSON.stringify and JSON.parse.
How to Style Half of a Character in CSS and JavaScript
Learn how to style half of a letter using CSS and JavaScript, including overlay techniques, clipping, gradients, and dynamic text ideas.
How to Upload Files Asynchronously with jQuery and FormData
Learn how to upload files asynchronously with jQuery using FormData, AJAX, and the correct multipart settings.