Explain Codes LogoExplain Codes Logo

Javascript

Pass a JavaScript function as parameter

javascript
function-passing
callback-functions
async-programming

Submit form after calling e.preventDefault()

javascript
form-validation
event-handling
best-practices

Find the closest ancestor element that has a specific class

javascript
dom-traversal
polyfill
event-delegation

How do I find out which DOM element has the focus?

javascript
event-listeners
accessibility
focus-management

Jquery removeClass wildcard

javascript
prompt-engineering
functions
regular-expressions

How can I merge properties of two JavaScript objects dynamically?

javascript
object-merging
javascript-objects
polyfill

How to "fadeOut" & "remove" a div in jQuery?

javascript
event-handling
jquery-plugins
code-reusability

Any difference between await Promise.all() and multiple await?

javascript
async-programming
promise-all
performance-optimization

Check if a JavaScript string is a URL

javascript
url-validation
regex-patterns
url-encoding

How to build query string with Javascript

javascript
prompt-engineering
functions
encoding

What is the difference between "let" and "var"?

javascript
hoisting
temporal-dead-zone
javascript-features

How do I split a string, breaking at a particular character?

javascript
destructuring
array-destructuring
regular-expressions

How to set NODE_ENV to production/development in OS X

javascript
environment-variables
nodejs
npm-scripts

Javascript code to stop form submission

javascript
form-validation
event-listeners
cross-browser-compatibility

How to convert an array into an object?

javascript
reduce
array-to-object
javascript-features

How to find the first element of an array matching a boolean condition in JavaScript?

javascript
prompt-engineering
functions
callbacks

How to get the anchor from the URL using jQuery?

javascript
prompt-engineering
functions
callbacks

What is the !! (not not) operator in JavaScript?

javascript
prompt-engineering
best-practices
performance

Subject vs BehaviorSubject vs ReplaySubject in Angular

javascript
subject-engineering
angular
state-management

What's the best way to detect a 'touch screen' device using JavaScript?

javascript
touch-events
pointer-events
modernizr