Questions

JavaScript questions

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

Abort Ajax Requests with jQuery jqXHR.abort()

Learn how to cancel an in-progress jQuery Ajax request with jqXHR.abort(), handle abort status safely, and avoid stale UI updates.

javascriptjqueryajax

Access the Correct this Inside a JavaScript Callback

Learn why JavaScript this changes in callbacks and how to preserve an object context using bind, arrow functions, and event handler patterns.

javascriptcallbackthis

Add Key-Value Pairs to JavaScript Objects

Learn how to add key-value pairs to JavaScript objects with dot and bracket notation, dynamic keys, examples, and common mistakes.

javascriptobject-literal

Adding Table Rows with jQuery: append(), Limits, and Best Practices

Learn how to add table rows in jQuery using append(), what elements are allowed in tables, and safer ways to build rows dynamically.

javascriptjqueryhtml-table

Bower vs npm: What’s the Difference in JavaScript Package Management?

Learn the plain difference between Bower and npm, how each manages packages, and why npm replaced Bower in most JavaScript projects.

javascriptnpmbowerdependency-management

Can `(a == 1 && a == 2 && a == 3)` Ever Be True in JavaScript?

Learn how JavaScript type coercion, loose equality, and custom object conversion can make `a == 1 && a == 2 && a == 3` true.

javascriptecmascript-6

Change the URL Without Reloading in JavaScript

Learn how to change a browser URL without a page reload using JavaScript’s History API, including pushState, replaceState, hashes, and routing.

javascripthtmlurlurl-rewriting

Check If an Element Exists in jQuery

Learn how to check whether an element exists in jQuery using .length, truthy pitfalls, and practical patterns for real projects.

javascriptjquery

Check Object Properties in JavaScript: hasOwn, in, and Object.hasOwn

Learn reliable ways to check whether a JavaScript object has a property, including Object.hasOwn(), hasOwnProperty(), and the in operator.

javascript

Check Whether a Checkbox Is Checked with jQuery

Learn how to check a checkbox by its ID with jQuery using :checked, .is(), and safe selectors, including common mistakes to avoid.

javascriptjqueryhtmlcheckbox

Check Whether a String Is a Valid Number in C#

Learn how to validate numeric strings in C# with TryParse, choose number types, handle cultures, and avoid unreliable regex checks.

javascriptvalidationnumeric

Check Whether an Object Has a Key in JavaScript

Learn reliable ways to check object keys in JavaScript, including Object.hasOwn(), the in operator, and handling undefined or falsy values.

javascriptobject

Checking for null, undefined, and empty values in JavaScript

Learn how to check for null, undefined, and empty values in JavaScript, including strings, arrays, and common pitfalls.

javascriptnullcomparisonundefined

Compare Two Dates in JavaScript: Greater Than, Less Than, and Not in the Past

Learn how to compare two dates in JavaScript, including greater than, less than, and checking whether a date is not in the past.

javascriptdatedatetimecompare

Convert Decimal to Hexadecimal in JavaScript

Learn how to convert decimal numbers to hexadecimal in JavaScript with toString(16), examples, validation, padding, and common pitfalls.

javascripthexnumber-formattingradix

Copy Arrays by Value in JavaScript: Shallow and Deep Copies

Learn why JavaScript array assignment shares a reference and how to create independent shallow or deep array copies safely.

javascriptarraysdeep-copypass-by-value

Count Object Properties Efficiently in JavaScript

Learn how to count own object properties in JavaScript with Object.keys, including inheritance, performance, and common pitfalls.

javascriptperformancepropertiescount

DOM Ready in Vanilla JavaScript: DOMContentLoaded and Alternatives

Learn how to run JavaScript when the DOM is ready without jQuery using DOMContentLoaded, readyState checks, defer scripts, and load events.

javascriptjqueryhtml

Deep Cloning Objects in JavaScript: Methods, Trade-offs, and Best Practices

Learn how to deep clone objects in JavaScript, compare structuredClone, JSON methods, and recursive approaches with examples.

javascriptobjectclone

Detect Mobile-Friendly Capabilities with jQuery and JavaScript

Learn why jQuery cannot reliably identify mobile devices and use CSS media queries, matchMedia, and feature detection instead.

javascriptjquerymobilebrowser-detection

Page 1 of 8 - 151 questions

PreviousNext