Explain Codes LogoExplain Codes Logo

Javascript

What does the construct x = x || y mean?

javascript
short-circuit-evaluation
default-function-parameters
falsy-values

Length of a JavaScript object

javascript
object-properties
javascript-utility-functions
property-counting

Get index of selected option with jQuery

javascript
jquery-selectors
dom-manipulation
event-handling

Random color generator

javascript
color-generation
hsl-color-space
performance-optimization

How to remove undefined and null values from an object using lodash?

javascript
lodash
omitby
isnil

Disable same origin policy in Chrome

javascript
security
testing
development

How to interpolate variables in strings in JavaScript, without concatenation?

javascript
template-literals
string-interpolation
es6-features

Implode an array with JavaScript?

javascript
join
array-manipulation
string-operations

How to get the focused element with jQuery?

javascript
focus-detection
jquery
browser-behaviors

Mocha / Chai expect.to.throw not catching thrown errors

javascript
async-debugging
error-testing
mocha-chai

Ios JavaScript bridge

javascript
javascript-bridge
web-development
performance

Get data from fs.readFile

javascript
async-programming
callbacks
promises

Rails order by association field

javascript
promises
callbacks
arel

Set type for function parameters?

javascript
type-checking
javascript-features
best-practices

Get JavaScript object from array of objects by value of property

javascript
array-methods
filter
find

How to measure time taken by a function to execute

javascript
performance
timing
functions

Syntax for an async arrow function

javascript
async-functions
promises
await

How to check if a function exists in JavaScript?

javascript
function-existence
optional-chaining
eval-safety

How to create an array containing 1...N

javascript
array-initialization
javascript-arrays
performance-optimization

How can I get all a form's values that would be submitted without submitting

javascript
form-data
ajax-requests
event-listeners