Explain Codes LogoExplain Codes Logo

Javascript

Javascript check if variable exists (is defined/initialized)

javascript
variable-checks
truthiness
type-coercion

Why don't browsers throw an error when any other word is used in place of 'javascript' in the value of onclick?

javascript
labels
onclick
user-experience

Check if a string is a date value

javascript
date-parsing
momentjs
browser-compatibility

Disable/enable an input with jQuery?

javascript
jquery
input
event-handling

How do I remove a property from a JavaScript object?

javascript
delete-operator
object-destructuring
array-manipulation

How to toggle a boolean?

javascript
boolean-toggling
best-practices
ui-state-management

Jquery Get Selected Option From Dropdown

javascript
dropdown
jquery
dom-manipulation

How to extend an existing JavaScript array with another array, without creating a new array

javascript
array-extensions
performance
best-practices

How do I convert an array of Objects into one Object in JavaScript?

javascript
reduce
performance
object-merging

Sort array by firstname (alphabetically) in JavaScript

javascript
sorting
localecompare
array-methods

How to add/update an attribute to an HTML element using JavaScript?

javascript
attribute-manipulation
cross-browser
jquery

Get current URL with jQuery?

javascript
url-manipulation
jquery
history-api

Get selected text from a drop-down list (select box) using jQuery

javascript
dropdown
jquery
best-practices

How can I get the index of an object by its property in JavaScript?

javascript
find-index
method-chaining
browser-support

Programmatically navigate using React router

javascript
react-router
navigation
hooks

Inserting HTML elements with JavaScript

javascript
html-insertion
document-fragment
template-management

Get list of data-* attributes using JavaScript / jQuery

javascript
data-attributes
performance
jquery

Get viewport/window height in ReactJS

javascript
responsive-design
custom-hooks
event-listener

Adding two numbers concatenates them instead of calculating the sum

javascript
type-conversion
input-validation
parseint

How to wait until an element exists?

javascript
async-await
mutation-observer
element-detection