Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
JavaScript is a versatile, high-level programming language. It is the programming language in all browsers.and can be used for back-end programming with node.js. Use this tag for questions regarding vanilla JavaScript; optionally tagged with an ECMAScript version. If you are using a preprocessor such as TypeScript please tag with that too.
3
votes
Selects all elements with a specific data attribute and equalizes their heights
data attribute
It's a bit unconventional to use a data attribute to select the affected elements. A class would be the more conventional approach.
Use of template strings
You have two places where …
3
votes
Accepted
Categorize similar transactions
I'd like to disagree with @riskypenguin in two points of his otherwise great review:
Partitioning
@riskypenguin suggests for partitioning the transactions into categorized and uncategorized to use .fi …
1
vote
Accepted
Converting numbers 1-99 to Spanish in Javascript
The function declarations are at least lacking a const statement (or let or var if you prefer):
const getSpanishCardinal = cardinal => {
However I would suggest to using regular function statements …
7
votes
String to Integer (atoi)
Unfortunately there are several problems with your code. It only reason it works is because you are using parseInt which (as @wOxxOm shows) fulfills the original task requirements and thus ignores you …
2
votes
Collapsing The Divs Using JavaScript
.); // chevron-up icon
}
This way you also don't need to switch the chevron-up/chevron-down classes in the JavaScript.
In JavaScript don't use the on... event properties. …
1
vote
Accepted
AdBlock Syntax Highlighter (Part 1 - AdBlockSyntaxLine Class)
don't think I can review all of that, but here are some thoughts to your questions and some general remarks.
const/let
I would guess this is simply that your programming style colliding with the trend in JavaScript …
3
votes
CSS Alphabetizer
To be honest, I didn't read all of the code. I gave up half way through. I believe this is due to two points:
You are not using the established CSS terms, e.g. "block" instead of "rule" and "paramete …
2
votes
Improving function that parses string and returns first integer present
I believe you have either misunderstood the task, or misunderstood Number.isNaN. In any case the if doesn't do anything usefull. Number.isNaN returns true only when the value is exactly NaN, which is …
1
vote
Simple Counter Program
Don't use template strings (`number`) if you are not actually using templates. Use normal single or double quotes: 'number' or "number".
10
votes
Rosary app for the Palm Pre
IMHO the code really needs a lot of work.
Use array literals to construct your arrays:
var chaplet = ["The Joyful Mysteries","The Luminous Mysteries" /* ... */ ];
var mystery = [
["Annunc","Vi …
4
votes
Accepted
Age in days, months and years
You should check if formattedDate is actually a Date object before using it (and change the variable name, since it sounds like it contains a formatted string).
It's strange, if not wrong, to conside …
2
votes
JavaScript - Comparing 2 arrays - Would like to check if I'm reinventing the wheel or am I g...
Some general advice:
You should use a function, even in this demonstration code. It's makes it clearer what the input and output are.
You should chose better variable names. newarr doesn't make sen …
5
votes
Array to Grid using a table
Since you are building the board with JavaScript I'm assuming that you want to modify the content of the board dynamically. … (If not then the question would be why you are using JavaScript and not a server-side generation).
In that case it could make sense to separate generation and filling the board. …
1
vote
Accepted
Message Object - Best Practice? | Consider data attribute for pulling text in
I don't really understand what you are asking here, but I'll give some general pointers:
I find that you have two different variables called Message very confusing.
It's not really a good idea to a …
2
votes
Class to interact with cookies
The only thing I'd suggest is that there is no real need for it being a class, since it's basically a singleton. So I'd use:
var Cookies = {
// The same as your function
};