# Tag Info

Accepted

### You hate h̶a̶t̶s̶ reputation? Click here to get rid of it

It would be better to do this with a user style, e.g. using the Stylus extension, like this: .rep, .reputation, .reputation-score { visibility: hidden; } One ...
• 2,969
Accepted

### Count all vowels in string

An alternative route is to use string.replace() and Regular Expressions to strip everything but the vowels from the string. Then count the length of the resulting ...
• 24.8k

### Using fetch() and a new Promise object to get API results

A few comments: 1) fetch already returns a promise, which means this: ...
• 2,525

### You hate h̶a̶t̶s̶ reputation? Click here to get rid of it

You could use querySelectorAll instead of getElementsByClassName. That way, you have a bit more flexibility in targeting ...
• 24.8k

### Count all vowels in string

I'm just wondering if there's an easier way to solve this problem without the big blocky code in the if statement. Well, you could put all of those in an array: <...
• 24.8k
Accepted

### Check if images are loaded (ES6 Promises)

Well, you normally don't want to use the Promise constructor in your higher level code, you want to Promisify as low as possible. So let's create a function that ...
• 4,637

### Setting flags to show three buttons

You could take an object and check if the action exists. If so, take the value as key for assignment. ...
• 704

### You hate h̶a̶t̶s̶ reputation? Click here to get rid of it

Update url UserScripts have the magical ability to update themselves if you provide a link to a raw version of your script as a UserScript header: Note: You actually have to increase the version, or ...
• 11.8k
Accepted

### Convert minutes portion of time to decimal

Use const instead of let to declare variables if the value doesn't change. You are executing ...
• 10.3k
Accepted

### Array duplicate removal for duplicates exceeding N-number

As you expected, there is a much simpler way to do this. Create a map where the keys are the numbers in the array and the value is the number of times each number appears in the array. Filter the ...
• 3,416
Accepted

### JavaScript/ECMAscript 6 classes organization

Most interesting, In BaseObject, you should really have a constructor that builds this.listeners, it would make your code much ...
• 32.4k

### Stack Exchange rev​iew queue notifications

I don't see much benefit to the enum. The Notification.permission string (or the return value of requestPermission()) is already ...
• 8,553

### Vue.js search functionality

One improvement would be factoring out the repeated call to this.search.toLowerCase() and storing the result in a block-scoped constant so it: doesn't need to be ...
• 24.8k
Accepted

• 1,530
Accepted

### Reformatting a date from YYYY-MM-DD to MM/DD/YYYY

Simpler approach Another option is to construct a Date object (this can be achieved by appending a time at midnight to the date) and pass that to ...
• 24.8k
Accepted

### Using async / await with dynamic import() for ES6 modules

Approach 2 does not work because accoring to MDN: import '/modules/my-module.js'; Is how you import a module for Import a ...
• 568
Accepted

### If non-array property exists convert it to one and push new value

Basically after reading over the code, I interpret that the conditional (i.e. !obj[key].push) checks if the value at the given ...
• 24.8k
Accepted

### Draw sine wave going around a circle

Overall you have a good D3 code here, congrats (I'm fairly impressed with the questions I've seen here at CR lately, from people claiming "This is the very first time I've used d3 or drawn a SVG&...
• 1,436
Accepted

### Restructuring JSON to create a new JSON where properties are grouped according to similar values

Scoping issues You are using an "immediately invoked function expression" (IIFE) here to scope the unique_dates, but in the process you forgot to use the ...
• 25k

### Count all vowels in string

Sᴀᴍ Onᴇᴌᴀ answer has the right idea for small strings, but can be improved by using a Set to hold the vowels rather than an array. This reduces the overhead of ...
• 19.9k
Accepted

### Vue.js search functionality

It is really hard to say, but at least for me, your code is fine. It seems readable and has no issues. Perhaps if you want to change the style and make it more "canonical", you could write ...
• 1,243

### Counting words from stored .md files

How to modify this code, so it doesn't use forEach? One way to achieve this is using Array.prototype.reduce(): ...
• 24.8k
Accepted

### Error solution: Uncaught TypeError

Does this open up the possibility for any buggy behavior that I don't know about? It's not likely to. The if statement is fine, though it can be made cleaner: ...
• 8,553

### JavaScript/ECMAscript 6 classes organization

So, going to 'answer' my own question here with a nice thing I discovered since then. Might expand my answer if I discover more stuff. In ECMAscript 6 rather than ...
• 488
Accepted

### Vue - It's the Royal Game of Ur

warning: cheesy meme with bad pun below - if you don't like those, then please skip it... Question responses Do I have too many / too few components? I am aiming to make several other games in Vue ...
• 24.8k
Accepted

### Chart of Percentage questions Answered

When I ran your script and started digging through the dom, I noticed that Apr 21 12:00 AM was missing -- I wonder why that was. Anyhow, I wanted to encourage ...
• 7,596

### Find all letter Combinations of a Phone Number

whenever you encounter a task where you have to combine or permute things, then backtracking is a possible approach. True. It is not necessarily the best though (in fact it is rarely the best). In ...
• 53k

### Expanding powers of expressions of the form ax+b

You don't need the special case for k == 0. When k == 0, the result of the other expression will be 1 as well. For this ...
• 20.9k
Accepted

### MMMRjs a product of BYTES Genesis

Comments The comments such a This is Mean. are pointless. And the comment ...
• 10.3k