Explain Codes LogoExplain Codes Logo

Javascript

How to detect a mobile device with JavaScript?

javascript
responsive-design
mobile-device-detection
user-agent

Determine whether an array contains a value

javascript
array-methods
performance-optimization
best-practices

Jquery Data vs Attr?

javascript
prompt-engineering
best-practices
data-attributes

Can I mark a field invalid from JavaScript?

javascript
validation
client-side
server-side

How do I get the coordinates of a mouse click on a canvas element?

javascript
event-handling
canvas
coordinates

Split large string in n-size chunks in JavaScript

javascript
prompt-engineering
performance
best-practices

How can I capitalize the first letter of each word in a string using JavaScript?

javascript
functions
regex
best-practices

Pass value to iframe from a window

javascript
cross-origin-communication
iframe-communication
postmessage

Replace multiple strings with multiple other strings

javascript
functions
regex
performance

Why isn't my JavaScript working in JSFiddle?

javascript
event-listeners
function-declaration
scope-and-closures

Pass a string parameter in an onclick function

javascript
event-handling
dom-manipulation
best-practices

Open a URL in a new tab (and not a new window)

javascript
event-driven-programming
popup-blockers
ajax-calls

Jquery .live() vs .on() method for adding a click event after loading dynamic html

javascript
event-delegation
performance-optimization
best-practices

Onclick javascript to make browser go back to previous page?

javascript
onclick-event
browser-history
javascript-functions

How can I perform a debounce?

javascript
debounce
react-hooks
async-programming

How can I set focus on an element in an HTML form using JavaScript?

javascript
focus
javascript-dom
accessibility

How can I convert a string to boolean in JavaScript?

javascript
boolean-conversion
javascript-operators
truthy-falsy-values

Print content of JavaScript object?

javascript
json-stringify
console-log
object-printing

What's the difference between `typeof` and `instanceof` in JavaScript and when should they each be used?

javascript
type-checking
instanceof
typeof-operator

How to parse float with two decimal places in javascript?

javascript
float-parsing
decimal-places
performance-optimization