Questions
JavaScript questions
Choose a question page, learn the concept, then test your understanding with a quiz.
How to Check Whether a String Starts With Another String in JavaScript
Learn how to check if a string starts with another string in JavaScript using startsWith, index checks, and safe fallback patterns.
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 Undefined in JavaScript
Learn the correct ways to check for undefined in JavaScript, including typeof, strict comparison, and when each approach is safe.
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 for undefined or null in JavaScript
Learn how to detect undefined and null in JavaScript correctly, with examples, pitfalls, and practical patterns for real code.
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 Check if an Object Property Is Undefined in JavaScript
Learn how to check whether an object property is undefined in JavaScript, including safe patterns, examples, and common mistakes.
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 Convert a String to an Integer in JavaScript
Learn how to convert a string to an integer in JavaScript using Number, parseInt, and unary plus with examples and common mistakes.
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 Immutable Enum-Like Objects in JavaScript
Learn how to create enum-like values in JavaScript and prevent changes using Object.freeze, constants, and common patterns.
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 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.
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.