Questions

JavaScript questions

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

How to Get a Timestamp in JavaScript

Learn how to get the current timestamp in JavaScript, including Unix time, milliseconds, seconds, and common date pitfalls.

javascriptdatetimetimestampdate-arithmetic

How to Get the Current URL in JavaScript

Learn how to get the current page URL in JavaScript using window.location, with examples, common mistakes, and practical use cases.

javascripturl

How to Get the Selected Value from a Dropdown in JavaScript

Learn how to get the selected value from an HTML dropdown using JavaScript, with examples, common mistakes, and practical use cases.

javascripthtml-select

How to Include One JavaScript File in Another JavaScript File

Learn how JavaScript files are loaded and how to share code using script tags and ES modules in modern JavaScript.

javascriptfileimportinclude

How to Insert an Item into an Array at a Specific Index in JavaScript

Learn how to insert values into a JavaScript array at a specific index using splice, with examples, pitfalls, and real-world use cases.

javascriptarrays

How to Iterate Through Object Properties in JavaScript

Learn how for...in works in JavaScript, why the loop variable receives object property names, and how to iterate safely.

javascriptloopsobject

How to Loop Through a JavaScript Object: Keys, Values, and Entries

Learn how to loop through a JavaScript object and access its keys and values using for...in, Object.keys, Object.values, and Object.entries.

javascriptloopsfor-loopeach

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 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 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 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 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 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 2 of 3 - 60 questions