Skip to main content
12253 votes
51 answers
13.6m views

How do I remove a specific value from an array? Something like: array.remove(value); Constraints: I have to use core JavaScript. Frameworks are not allowed.
Walker's user avatar
  • 136k
8741 votes
67 answers
3.3m views

How do I toggle the visibility of an element using .hide(), .show(), or .toggle()? How do I test if an element is visible or hidden?
Philip Morton's user avatar
8540 votes
32 answers
1.2m views

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error: Problem at line 1 character 1: Missing "use strict" statement. Doing some searching, ...
Mark Rogers's user avatar
  • 97.9k
7694 votes
58 answers
8.2m views

How can I redirect the user from one page to another using jQuery or pure JavaScript?
venkatachalam's user avatar
7671 votes
42 answers
1.2m views

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent. The previous developer used two ways ...
Richard Garside's user avatar
7609 votes
86 answers
1.6m views

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves? I ...
7585 votes
40 answers
3.4m views

Given an object: let myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; How do I remove the property ...
johnstok's user avatar
  • 98.6k
7403 votes
3 answers
8.4m views

Usually I would expect a String.contains() method, but there doesn't seem to be one. What is a reasonable way to check for this?
6743 votes
44 answers
2.2m views

How do I return the response/result from a function foo that makes an asynchronous request? I am trying to return the value from the callback, as well as assigning the result to a local variable ...
Felix Kling's user avatar
6408 votes
38 answers
2.4m views

ECMAScript 6 introduced the let declaration keyword. I've heard that it's described as a local variable, but I'm still not quite sure how it behaves differently than the var keyword. What are the ...
TM.'s user avatar
  • 112k
6381 votes
72 answers
4.5m views

How do I include a JavaScript file inside another JavaScript file, similar to @import in CSS?
Alec Smart's user avatar
  • 96.2k
5809 votes
41 answers
5.5m views

How can I loop through all the entries in an array using JavaScript?
Dante1986's user avatar
  • 60.3k
5643 votes
47 answers
2.2m views

I'm using JSLint to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value....
bcasp's user avatar
  • 57.3k
5517 votes
50 answers
4.6m views

Given a string: string = "Test abc test test abc test test test abc test test abc"; This seems to only remove the first occurrence of abc in the string above: string = string.replace('abc', ...
Ali's user avatar
  • 268k
5494 votes
77 answers
3.3m views

How do I create GUIDs (globally-unique identifiers) in JavaScript? The GUID / UUID should be at least 32 characters and should stay in the ASCII range to avoid trouble when passing them around. I'm ...

15 30 50 per page
1
2 3 4 5
168335