Category "javascript"

Differentiating custom Typescript Interfaces that have the same fields

I have a custom interface like this: interface Pointer<T> { id: string } id is a pointer to other data structures, but the id field doesn't contain inf

how to stop multiple notifications changing positions?

i have a small notifications problem, when i insert a element the position of first element is changing so i wanna make it when the element is inserted the firs

How to do a simple string token replacement in Azure pipelines?

In a YAML release pipeline, I need to do a simple replacement in the js files contained in the artifact coming from another pipeline. These files have a certain

The best way to implement override data state from parent class

I'm facing a really hard problem. I want to create a wrapper class that can do something like "override" the state of the child without affecting the child's st

Is it possible to prevent higher order function execution in Jest test, if passed callback is a mock?

I have a function which makes a lot of calculations and returns order of sorting. For that function I have tests. Then, that function is used inside of JS nativ

Pino-tee logs twice on other logs

References: https://github.com/pinojs/pino-tee I have two logs, info.log and error.log but the thing is, when I go to info.log, the log for error.log is there S

Prevent scroll bar to go up when click mobile nav

I have a mobile nav and I open it using this code in JS file: var toggleButton = document.querySelector(".toggle-button"); var mobileNav = document.querySel

How to tell the browser to do the javascript manipulated webpage scaling before any content starts to show up?

I am building a website for me and I care about performance, speed, user experience and a lot more. When I started I didn't know much and I made an initial desi

How to retrieve all rows using Azure Table Storage bindings for Azure Functions

I am using azure table storage bindings as described here https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table-input?tabs=in-

looping through an array of objects that contains three key, value pairs

I have these objects, which could be in an array, like in the example or a database: [ { "payer": "DANNON", "points": 1000, "timestamp": "2020-11-02T14:00:0

Using an async function in Array.find()

It seems I'm unable to use an async function as the first argument to Array.find(). I can't see why this code would not work what is happening under the hood?

Using this JS function, how can I store in a SQL database TMDB fields?

I'm currently developing a project that will be Client on Java and Admin on PHP. For this purpose, I would like to store the API's data in a SQL database, so th

Socket.IO cannot establish a connection

I use socket.io-client for Javascript server on JAVA and when I enter address 'ws://10.201.223.67:9902/' the request is not by 'ws' but by 'http'. It returns

URQL WSS connection with GraphQL-WS says error 4500

import { createClient, defaultExchanges,dedupExchange, cacheExchange, fetchExchange, subscriptionExchange, gql } from "@urql/core"; import { createClie

import { withAuthenticator } from '@aws-amplify/ui-react' error

I'm trying to complete a type-along and I keep receiving an error for authentication when trying to upload images as an object. Here is the link of the type-alo

How to use .map to get sting from array

This is my first question because I'm just new to coding. I want to use .map to get strings from an array. let root_vegetables = ['potato', 'taro', 'sweet p

Dynamically added svg viewbox values not working? [duplicate]

I'm trying to add an svg dynamically to a menu, but I'm having a problem setting the viewbox. When I inline the svgs (svg and svg-2), the view

How do I add a delay in a JavaScript loop?

I would like to add a delay/sleep inside a while loop: I tried it like this: alert('hi'); for(var start = 1; start < 10; start++) { setTimeout(function

Unexpected token ')' in D:\Mridul\Codes\js\API BASED\Anime Quote\views\info.ejs while compiling ejs

So I want to display MongoDB data in HTML so I used the EJS template but this is the error it is showing . I can't seem to figure out where the problem is, IS i

How to render "intrinsic" size of element with Dom-To-Image

I'm using tsayen's dom-to-image library to snapshot an image element. The intrinsic size of my image is close to 1000x1000px, but on my website I have it scaled