Category "javascript"

Animate reused svg independently

I want some SVGs to animate on click. The SVG is defined once and has been reused multiple times with the <use> tag. I wrote the following code: svg {

How to hide radar chart index labels (chart.js)

I'm trying to make a radar chart with a dark background. White index labels distract from the chart itself. (my chart) I found a thread that raised a question a

Is it possible to assign opacity to a SCSS hex color variable, re using that variable?

I have a series of scss variables representing colors re used throughout my app, like so: $first-color: #00755E I also have colors that are the same as this fi

Vue.js computed boolean incorrect

I need a computed property for whether startDate is less than endDate. For some reason when I code it as below, the computed property always computes as false e

Counting words in string

I was trying to count words in a text in this way: function WordCount(str) { var totalSoFar = 0; for (var i = 0; i < WordCount.length; i++) if (str(i

How to use Promise.prototype.finally() in async/await syntax?

Actually my main question was using Promise.prototype.catch() in async/await ES8 syntax, Undoubtedly Promise.prototype.then() is existed in essence of async/awa

Import JSON data into a Microsoft Word template?

I am currently working on an application that grabs information from an API and returns it as JSON. The purpose of all the data is to fill in a Microsoft Word d

How to share state (react)between electron's multiple windows?

I am developing a desktop app with react for UI and electron. So, for now, I am fetching data from the server and saving it in the state using React's Context

How can I implement a lazy-minting smart contract that doesn't actually mint NFTs?

This is my first experience writing a smart contract, so I am still trying to navigate how this all works. I have a smart contract on the Rinkeby test network t

Vue - How to access component's property from Vuex

In my app I use Vuex to perform async tasks. In this case I use it to log user to my app. When user is logged and axios.then() is being performed I want to info

node.js moongose find populate cant access to array

I have this in my backend: ad = await Ad.find({'company': companyId}).populate('creator'); And when i console.log(ad) i get this: [ { connections: [],

How can we set a default value of a v-text-field of vuetify in nuxtjs?

I am new to vuejs and nuxtjs and at my company they are using vuetify. I need to set default value as 0 to v-text-field fields in the application but I cant fin

Filtering array with Boolean giving unexpected results

I can't understand why the output is 17 its only returning the true values not the false values either that the false value are boolean also function countSheep

How to access the mainWindow from another script in Electron?

My electron app defines the BrowserWindow mainWindow in the main.js. It loads an html and eventually inside of the html a script runs the function dialog.showMe

requiring a directory rather than a js file

I come across a piece code like this in an index.js file: exports = module.exports = require("./src") Not sure what the exports = module.exports bit means. And

Why is req.body undefined in Express?

I am creating a PUT method to update a given set of data however in my update function, req.body is undefined. controller.js async function reviewExists(req, re

Is possible to see output data when tracking a transaction from its address on Etherscan?

I wonder if it is possible to see "Output Data" on Etherscan for non-view transactions that returned values, I mean it is possible to see "Input Data" when fetc

"istanbul ignore next" command seems to be ignored

I'm trying to use Jest to test my code. It was working quite fine until I tried to exclude a class method from the tests. The querySelector() call is the reason

Check if rotation of model has changed?

How would you check if the rotation of a model has changed? tried: var oldRotate = this._target.quaternion; console.log('works returns vector3 quaternion: ',

how to call firebase callable functions from localhost?

I get this error: whenever this cloud function is called: const makeAdmin = firebase.functions().httpsCallable("makeAdmin"); makeAdmin({