Questions
JavaScript questions
Choose a question page, learn the concept, then test your understanding with a quiz.
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.
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 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 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.
How to Check for Empty, Undefined, or Null Strings in JavaScript
Learn how to check for empty, undefined, and null strings in JavaScript with clear examples, common mistakes, and practical patterns.
How to Check for an Empty Object in JavaScript
Learn how to test whether a JavaScript object is empty using Object.keys, loops, and safe patterns with clear examples.
How to Check if a Checkbox Is Checked in jQuery
Learn how to check whether a checkbox is checked in jQuery using prop(), is(), and change events with clear examples.
How to Check if a Key Exists in a JavaScript Object
Learn how to check whether a key exists in a JavaScript object or array, what happens when it is missing, and which method to use.
How to Check if a String Contains a Substring in JavaScript
Learn how to check whether a string contains a substring in JavaScript using includes, indexOf, and practical examples.
How to Check if a Value Is an Array in JavaScript
Learn how to check whether a value is an array in JavaScript and safely handle a single string or list of strings in functions.
How to Check if an Element Is Hidden in jQuery
Learn how to show, hide, toggle, and test element visibility in jQuery with clear examples, common mistakes, and practical patterns.
How to Clone a JavaScript Object Correctly
Learn shallow vs deep cloning in JavaScript, how object copying works, and the safest ways to clone objects without changing the original.
How to Convert a String to Boolean in JavaScript
Learn how to convert 'true' and 'false' strings to booleans in JavaScript, including safe patterns, pitfalls, and form input examples.
How to Copy Text to the Clipboard in JavaScript
Learn how to copy text to the clipboard in JavaScript using the Clipboard API and fallback techniques for browser support.
How to Create Multiline String Literals in JavaScript
Learn how to assign multiline string literals to variables in JavaScript, including template literals and common mistakes to avoid.
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.
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.
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.
Page 1 of 3 - 60 questions