Category "javascript"

Dynamically access object property using variable

I'm trying to access a property of an object using a dynamic name. Is this possible? const something = { bar: "Foobar!" }; const foo = 'bar'; something.foo; //

Javascript objects equality vs using the spread operator to create new objects [duplicate]

When I have an object defined as such, const obj = { first: "hey", second: "hello" } and I do not wish to modify this but create a ne

How to implement this function declaration or function expression with arrow function? [closed]

<p class="qn"><a href="#"> Question:What is JavaScript?</a></p> <p class="answ "> JavaScript is a ligh

How to solve map loop not working to print data ( component ) ? React

I have three componente ComponentFather ( grand Parent component ) ComponentChild ( Child component of ComponentFather) ComponentChildChild ( Child component of

API values to set opacity levels to show overlapping points in highcharts scatter?

Looking at the demo for scatter charts I can see what when two points overlap they become more opaque: https://www.highcharts.com/demo/scatter I'm pulling data

spread operator vs immutable.js

It seems like when using redux with react, immutable.js has become almost a industry standard. My question is, aren't we making changes to our redux states immu

Smooth Page transition with zoom in animation in React js

On my product store spa web app I want smooth zoom in page transition. Like when the product card or the detail button is clicked , it will take the user to the

Change options when I select a category using Javascript (Country/State)

Im trying to hide some options when I select a different country. These options are the states of this country. But, when I select the country, it doesnt showin

Able to proxy my React app in localhost to heroku server but not on firebase

I was wondering if there was a way to proxy my firebase-deployed app to redirect all requests to a heroku API URL. { "name": "denrol", "version": "0.1.0",

Deleting row in one sheet if cell value is found in another sheet

I am trying to delete rows if cell value is found in another sheet via App Script. But the code is not going through complete data in history sheet. function de

Firefox (geckodriver): How do I inject JavaScript functions into a page so that they persist upon return from 'executeScript'?

I have a Selenium Java library that includes a JavaScript "glue" library that enables JavaScript functions to throw serialized Java exceptions. This enables muc

Resizing THREE.js Object using HTML div

I have two divs that I want to place side-by-side, and one of them contains my THREE.JS window/canvas. Basically, I don't want the THREE.js to take up the entir

OpenSea Error - Please use providerUtils.standardizeOrThrow()

I'm having trouble using the openseas.js library. I'm trying to do a getAsset call on a random asset on openseas I found, but I keep getting Error: DEPRECATED:

I am getting "AssertionError: Expected transaction to be reverted with Username " when I am testing my solidity code

When I am running npx hardhat test on the below smartcontract I am getting AssertionError: Expected transaction to be reverted with Username is taken please try

Error in Jest Test with Vanilla Javascript: expect(jest.fn()).toBeCalledWith(...expected) Expected: "click", Any<Function> Number of calls: 0

Looks like click method is not getting triggered I have tried evreything, it would be appreciated if someone knows the answer I'm getting this error: expect(jes

Can this search bar autosuggest by any word?

The search bar only suggest results by the first letter of the first word, can i make it suggest by de contains of the result that I'm looking for, for example

How to expose any API globally on Node

I have a web development framework which I use on personal backend projects. All web apps revolve around my framework and the API is quite big so importing it i

How to use the JSON response from a Python App, To render it with Javascript on to an HTML page using Fast API? [duplicate]

I have an HTML page being rendered with FastAPI: @app.get("/index", response_class=HTMLResponse) def write_home(request: Request): return t

How to generate RSA PKCS5 keypair in Javascript?

I need to create a set of RSA keys (public+private) on the client (javascript), send it to the server (Ruby) that uses those keys to encrypt data, which is sent

Dynamic Text under Product Price on Product page in case a variation is selected

How can I create a text A under the product price on the product page in case a variation is not selected. When a variation is selected I would like to have ano