Category "javascript"

Checking the package.json version number on new Pull Requests

Is there any way to check the version number in package.json to make sure it was changed as part of the pull request requirements?

node_modules/@types/react/index"' has no default export

Trying to convert a React app over into Typescript and running into strange errors. node_modules/@types/react/index"' has no default export. node_modules/@type

In JavaScript, how to execute next function from an array of functions

I have an array of functions, as in: funcArray = [func1, func2, func3]; When in a given function, I want to execute the next function in the array. How do I

Shuffle nested arrays in Javascript

I'm trying to sort multiple arrays within an array (which also has to be shuffled). A simplified example is: let toShuffle = [ [1, 2, 3, 4, 5], [9, 8, 7, 6, 5],

jsp encoding display issue

I am finding a issue where the data is encoded properly in the controller and compiled jsp, but is not displaying properly within an alert statement (or on the

Sorting keys from and object based on the difference in value Javascript?

let scores = { A: 30, B: 40, C: 35, D: 90 } function getScores(students) { let result = [] let keys = Object.keys(scores) let difference = 0

How to see truncated text with hover in highcharts?

I'm using the highcharts-react-official package and sometimes my charts have texts that are long enough to be truncated. In those cases the texts end with "..."

Is there a way to build an interactive node graph in JavaScript?

I'm looking to build an interactive node graph on a webpage where you can add nodes with various inputs and outputs and connect them together. This is an examp

How to compare dates in Vuejs?

Hi I'm trying to make a library/book tracking app which tracks the date and returns the status like its returned or lost etc. I need to compare dates in my app

Best practice for navigation bars on modern websites

so I've been really struggling to find a good answer for this question... I have many html pages and one navigation bar. I want to include the navigation bar on

How can I redirect the parent page after OAuth 2 flow is complete?

My current flow is such: User clicks login to third party Upon grant, the third party redirects to configured redirect uri with code Forward code to backend to

ResizeObserver not being triggered on add & remove

I have a chat application which appends messages to the bottom, and when a limit is reached, it removes the oldest message. So it adds and removes a message at

MERN Application - Problem with notifications and mapping array

I'm on a MERN stack to create a chat application. And when I'm trying to display notifications when there is a new message in another chatroom or a new PM I'm h

Cheerio find child with class that starts with string

Currently I have an object which has a lot of children. I can find a particular child using: $(elem).find('.animal-type').text(); However, some of the animal

Watch height of an element in VueJS

Is there any way to set a watcher on the height of an element in VueJS? I am trying to fix the filters part on a search result page. but if the results change

How can I achieve something similar to a pointer to a string in javascript?

Is there a concept like a pointer to a string in javascript? Or how would this be done? let s1 = "hi"; let s2 = "bye"; // I want to write my code like this [,]

Firebase google signin authentication and popup is not working in React project

Actually I'm don't know a firebase just follow a react course and my instructor uses the same code but it's not working from my side... I have enabled google si

create-react-app: How do I "npm start" with a specific browser?

npm start starts the react server on the default browser, which is Firefox for me. I like Firefox for browsing but prefer Chrome in web development for its

Why does my shadow dom break my custom element?

Here is a JSFiddle demonstration of the custom element: https://jsfiddle.net/c4bLo097/5/ Here is the code from the fiddle: JavaScript: window.customElements.def

Build a plot from JSON with plotly.js

I have built a plot using plotly.py and convert it to JSON file: plotly.io.write_json(fig, 'name.json') After creating the JSON file I need to build the same