Category "javascript"

Failing tests -> Cannot read properties of undefined (reading 'rpc')

I was writing a test in TypeScript for Adding two numbers. I am receiving the following error: Adds two numbers: TypeError: Cannot read properties of undef

Why .getMinutes() output as :0 instead of :00 in JavaScript?

The .getMinutes() method only outputs one integer ‘0’ instead of two integers ‘00’. Why does it do this and is there a simpler way to fi

Custom place of filter input in react-bootstrap-table

I'm using react-bootstrap-table and I want to place the input filter of table columns in top of the table not on top/bottom on the column (default behavior). I

Multiple locales with date-fns in ReactJs

Using date-fns, i am trying to add multiple locales in my app, before i hade one only locale so the import was simply like this : import {fr as locale} from 'da

Adding a function to imports routes in app.use()

Hi everyone I have an API and I have made a function to check if a user is authenticated, if he is then the API redirects him to the home page else to the /logi

How to search for specific fields in an array of objects containing objects in a document and update them in firestore (firebase) (JS)

// Update the other user that current user has asked for revision export async function updateOtherUserForContractRevision(contractID : string, comments : any)

dynamic classes with tailwindcss and eleventy

I am using eleventy.js with tailwindcss and postcss. In my setup, postcss does not seem to recognise dynamic classes like md:pl-{{(loop.length-loop.index+1)*2}}

How to independently set a button click in react?

I am trying to figure out on how to set a button that can independently be disabled when using the .map function. So I created a state whenever the button is cl

canvas not adding image from url (base 64)

i am working on project where i want to create a min preview for canvas. so when any change happen to canvas eg: user added text to canvas , the canvas will be

Is there a way in Acrobat (ios or android) to send an email of a completed PDF form to an address that is entered in a field on the same form?

I have some javascript in an acrobat form PDF that works fairly well on a PC, but doesn't work on an ios device. My goal is to send an email to an address that

Files With A Tag in ObsidianMD

I'm trying to write a plugin that fetches the list of files containing a particular tag (like "#condition") in ObsidianMD for some downstream purposes. The buil

`puppeteer-page-proxy` with `https` has Error: net::ERR_FAILED or RFC 6066 error

I use puppeteer and puppeteer-page-proxy proxy. I don't have problem with use args: ['--proxy-server=socks5://127.0.0.1:9150',... with either http and https. I

How to force the transfer of an NFT using Web3.js or Ethers.js

I am trying to build an application, and part of it involves transferring an NFT from my account to the user's. Previously, I was using Moralis to accomplish th

How to get a value out of a callback function in javascript [duplicate]

var request = require('request'); var d; request('my.servers.ip?group=1', function (error, response, body) { let d = body }) console.l

How to add a single data point to a line graph in D3 without redrawing

I'm working on replacing a dynamic chart implemented in highcharts. The current implementation is a line-area chart that expands over time with incoming stream

not able to render element into screen by v-for

I got data from a DB, stored it in an array, but could not render it with V-For, neither did I get any error or warning. I have following data on my db: and he

How to use Google Identity Services JavaScript SDK with Vue / TypeScript?

I'm trying to authorize some Google APIs using the new Google Identity Services JavaScript SDK in my Vue / Quasar / TypeScript app. As per the docs I have loade

Playing background music in a React app using Howler

So im using Howler to play background music when my React app is loaded. So I store ID of the instance of Howler(i.e is responsible for background music) using

How to run npm start without opening browser for react development on linux

I am learning react and find myself running npm start on the terminal a couple of times but its annoying how it opens a new browser window everytime. I'm tryin

Open other webiste in new tab alogn with my website

I have a website-1 (www.example.com). When a customer reaches out to my website, the other website-2 (www.example2.com) should be open in a new tab correspondin