Category "javascript"

Display JS script result in Bootstrap color box

I want to display random numbers by JS calculation in CSS Bootstrap colored box as shown below. How can I structure my code by adding the following JS calculati

Adding an custom event to GTM Vimeo event tracking

I'm using this script to push play/pause/progress of vimeo videos on our website. I'd like to push another event "load" when video is loaded on page. I've tried

How do I get a menu to go on top of everything?

I am trying to have a menu that takes up 100vh when the menu button is clicked. However, I also have a header at the top so the menu content is lower than it. H

How to get the difference of two objects by subtracting properties, regardless of depth level?

I want to subtract the values of two objects of the exact same structure. Although one answer exists here, it's limited to objects of no-depth. In my case, I'm

UseEffect firing on initial render

I am creating a front end for an API that requires a user to input both an API key as well as a device name. The issue is that the UseEffect() fetch is firing w

Prevent multiple events using MutationObserver

I want to track a dynamic value of an input using jquery and trigger events depending on the progression (25%, 50%, 75% and 100%). In my case, the input is a pr

Sequelize how to return result as a 2D array instead of array of objects?

I am using Sequelize query() method as follows: const sequelize = new Sequelize(...); ... // IMPORTANT: No changed allowed on this query const queryFromUser = "

Does EsLint have a rule to prefer Object values as key and value?

Looking for a rule(can't seem to find anything, might've just missed it) in EsLint to basically prefer something like this: const example = { foo, bar }

Does anyone know how to get around Vuex getters not having a cache

My front end will be connected to great backend later right now it is extremely difficult to test my codes because vuex getters and setters do not cache data. S

From an array of objects, extract value of a property as array

I have JavaScript object array with the following structure: objArray = [ { foo: 1, bar: 2}, { foo: 3, bar: 4}, { foo: 5, bar: 6} ]; I want to extract a fiel

React JS App becomes blank white screen when deployed with AWS Amplify

I have a React JS app that works on local host, but when I deploy to AWS amplify displays as a blank white screen with no body. The browser tab shows the correc

dynamically get columns from 2D array

I have a 2D array of row,through which i want get the column coordinates/information just like i got for the row(rowArr2D) So,in my Column(colArr2D) i'm just ge

How to pick specfic data from json response javascript

How to pick specific data from JSON response javascript Background-Info I'm trying to create an application to view data from haveibeenpawned's API. I don't wan

JavaScript exponents

How do you do exponents in JavaScript? Like how would you do 12^2?

How to import js module when Typescript declaration file is located in a separate directory?

Question: When I run npm run build with the configuration below, rollup.js is unable to resolve the dependency (import) and displays the following message below

How to automate my first Telegram application?

I'm just learning the backend. I created my first application, all it does is get data -> publish it to a Telegram bot. I want the application to work 24/7.

Slick Slider React - How to keep the same width and space whatever the size screen?

I am creating a slider in react with Slick Slider. The problem is: when the screen size changes, the slides reduce in size or stack on top of each other. Slick

Angular MatStepper fails to recognize cached values from two str arrays (but successfully recognizes values from another str array)

I have a MatStepper that's used to navigate to the next page of a signup flow. I also have a method that loads values from a cache if it's available, and if so

How to align elements around the perimeter of a circle?

I'm trying to align elements around a circle like this: this is my code, I've added a drag function to rotate the wrapper box, I'm not very Math savy so I don

How to use any icons with Nuxt3?

I'm facing an error with Nuxtjs when I try to use the vue-fontawesome framework and also the @nuxtjs/fontawesome framework, this is the error: [nuxt] [request e