Questions

JavaScript questions

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

How to Create a GUID / UUID in JavaScript

Learn how to generate GUIDs and UUIDs in JavaScript safely, including browser support, randomness, and practical examples.

javascriptguiduuid

How to Create an Array from 1 to N in JavaScript

Learn how to create a JavaScript array containing numbers from 1 to N using loops, Array.from, keys, and practical patterns.

javascriptarraysrange

How to Disable and Enable an Input with jQuery

Learn the correct way to disable and enable form inputs with jQuery using prop(), attr(), and plain JavaScript examples.

javascriptjqueryhtml-inputdisabled-input

How to Display a JavaScript Object as a String

Learn how to display JavaScript objects with console.log, JSON.stringify, and readable formatting for alerts, debugging, and user interfaces.

javascriptserializationjavascript-objects

How to Empty an Array in JavaScript

Learn how to empty a JavaScript array using length, splice, reassignment, and pop, including how shared references affect each approach.

javascriptarrays

How to Encode a URL in JavaScript for Query Strings

Learn how to safely encode URLs in JavaScript for GET parameters using encodeURIComponent, with examples and common mistakes.

javascripturlencodeurlencode

How to Format Numbers as Currency Strings in JavaScript

Learn how to format numbers as currency strings in JavaScript using toFixed and Intl.NumberFormat with clear examples.

javascriptformattingcurrencynumber-formatting

How to Format a Date in JavaScript

Learn how to format JavaScript Date objects into strings like 10-Aug-2010 using built-in methods and simple custom formatting.

javascriptdatedatetimedatetime-format

How to Get Query String Values in JavaScript

Learn how to read query string parameters in JavaScript using URLSearchParams and classic approaches, with examples and common mistakes.

javascripturlpluginsquery-string

How to Get Selected Text from a Select Box in jQuery

Learn how to get the selected option text from a select box in jQuery, with examples, common mistakes, and practical usage patterns.

javascriptjquerydomdrop-down-menu

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 Date in JavaScript

Learn how to get the current date in JavaScript using Date, format it, and understand common mistakes with practical examples.

javascriptdatedate-formatting

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 Length of a JavaScript Object

Learn how to count properties in a JavaScript object using Object.keys(), when it works, and common mistakes to avoid.

javascriptobjectjavascript-objects

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 of Nested Objects

Learn how to iterate through a JavaScript object whose values are objects, using for...in, Object.keys, and Object.entries.

javascriptloops

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

Page 4 of 8 - 151 questions