Explain Codes LogoExplain Codes Logo

Javascript

How do I replace all occurrences of a string in JavaScript?

javascript
regex
string-replacement
best-practices

How do I check if an array includes a value in JavaScript?

javascript
includes
performance
polyfills

Format number to always show 2 decimal places

javascript
number-formatting
precision
localization

How to convert a string to an integer in JavaScript

javascript
string-conversion
parseint
number-function

How do I make the first letter of a string uppercase in JavaScript?

javascript
string-manipulation
browser-compatibility
performance

How can I determine equality for two JavaScript objects?

javascript
lodash
deep-comparison
es6

How to get a key in a JavaScript object by its value?

javascript
functions
best-practices
performance

How to get first N number of elements from an array

javascript
slice
filter
immutability

How to convert the "arguments" object to an array in JavaScript?

javascript
arguments
array-conversion
performance

Do I need to return after early resolve/reject?

javascript
promises
error-handling
code-readability

Javascript get x and y coordinates on mouse click

javascript
mouse-event
event-handling
responsive-design

Checking if a key exists in a JavaScript object?

javascript
key-checks
hasownproperty
object

Get checkbox value in jQuery

javascript
checkbox
form-submission
dom-manipulation

Reload an iframe with jQuery

javascript
iframe
user-experience
jquery

What's the Best Way to Break from Nested Loops in JavaScript?

javascript
nested-loops
break
array-methods

Convert a Unix timestamp to time in JavaScript

javascript
unix-timestamp
time-formatting
date-object

Is there a standard function to check for null, undefined, or blank variables in JavaScript?

javascript
truthiness
isempty
type-coercion

Parsing a string to a date in JavaScript

javascript
date-parsing
momentjs
regex

How can I create unique IDs with JavaScript?

javascript
unique-ids
dom-manipulation
event-driven

Stop an input field in a form from being submitted

javascript
form-handling
user-experience
dynamic-inputs