Questions

JavaScript questions

Choose a question page, learn the concept, then test your understanding with a quiz.

How to Loop Through an Array in JavaScript

Learn how to loop through array entries in JavaScript using for, for...of, forEach, and other common patterns with examples.

javascriptarraysloopsforeach

How to Loop Through an Array in JavaScript

Learn how to loop through array items in JavaScript using for, for...of, forEach, and map with clear examples and common mistakes.

javascriptarraysloopsfor-loop

How to Map Over Object Properties in JavaScript

Learn how to transform object values in JavaScript using Object.keys, Object.entries, and Object.fromEntries when no native object map exists.

javascriptnode.jsfunctional-programmingmap-function

How to Measure Function Execution Time in JavaScript

Learn how to measure function execution time in JavaScript using performance.now(), Date.now(), and practical timing patterns.

javascriptprofiling

How to Merge JavaScript Objects: Object.assign, Spread Syntax, and Practical Patterns

Learn how to merge JavaScript objects using Object.assign and spread syntax, including examples, overwrite behavior, and common mistakes.

javascriptjavascript-objects

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.

javascripttabshref

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.

javascriptnode.jsargumentscommand-line-arguments

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.

javascriptjsonpretty-print

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.

javascriptjqueryhttp-redirect

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.

javascriptjqueryrefreshreload

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.

javascriptjqueryarraysduplicates

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.

javascriptuniquearrays

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.

javascriptobjectproperties

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.

javascriptarrays

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.

javascriptstringreplace

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.

javascriptajaxasynchronous

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.

javascriptroundingdecimal-point

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.

javascriptjqueryscroll

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.

javascriptjqueryjquery-selectors

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.

javascriptjquerycheckboxselected

Page 5 of 8 - 151 questions