Questions
JavaScript questions
Choose a question page, learn the concept, then test your understanding with a quiz.
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.
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.
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.
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.
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.
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.
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.
Detect a Click Outside an Element in jQuery
Learn how to detect clicks outside an element in jQuery to close menus, modals, and dropdowns with clear examples and common pitfalls.
Format Numbers With Thousands Separators in JavaScript
Learn how to format numbers with commas as thousands separators in JavaScript using toLocaleString, Intl, and custom methods.
Generate Random Integers in a Range in JavaScript
Learn how to generate random whole numbers between two values in JavaScript, including inclusive ranges, formulas, examples, and common mistakes.
Generate a Random Number in a Range in JavaScript
Learn how to generate random numbers between two values in JavaScript, including inclusive ranges, formulas, examples, and common mistakes.
Generate a Random String in JavaScript
Learn how to generate a fixed-length random string in JavaScript using a custom character set like a-z, A-Z, and 0-9.
Get Screen, Page, and Browser Window Size in JavaScript
Learn how to get screen size, viewport size, page size, and scroll position in JavaScript across major browsers with clear examples.
How JavaScript Closures Work: A Beginner-Friendly Guide
Learn how JavaScript closures work with simple explanations, examples, common mistakes, and practical use cases for real code.
How to Add Elements to the Beginning of an Array in JavaScript
Learn how to prepend elements to the start of a JavaScript array using built-in methods like unshift and practical examples.
How to Append Items to an Array in JavaScript
Learn how to append strings, numbers, and objects to arrays in JavaScript using push, spread syntax, and immutable patterns.
How to Change an Element's Class with JavaScript
Learn how to change, add, remove, and toggle an HTML element's class with JavaScript using events like click.
How to Check If a Variable Exists in JavaScript
Learn the correct ways to check whether a variable is defined, initialized, null, or truthy in JavaScript with examples.
How to Check If a Variable Is a String in JavaScript
Learn how to check whether a variable is a string in JavaScript using typeof, instanceof, and safe patterns with clear examples.
How to Check If an Array Contains a Value in JavaScript
Learn how to check whether a JavaScript array includes a value using includes(), indexOf(), and common patterns with clear examples.
Page 1 of 6 - 104 questions