Category "javascript"

How to limit an array field in javascript object to a certain length

I know this may a simple problem but I have a the following javascript object: const categories = { title: 'cat1', contents: [ { nam

How to make app interact with other browser tabs?

Is there a way to make app display it's template above all other browser tabs when the application tab is not in focus (visibilityState == 'hidden')? For exampl

Weird issue with Vue / Javascript variables

I honestly don't even know how to search for this question (what search param to write) but either way its bit weird issue and I am desperate for help. So I am

D3 adding tooltip to multi-line chart

I am fairly new to javascript and D3, I am trying to create a tooltip that displays a vertical line and circles on that line along with the value of data in eac

Getting null when I use context.query with getServerSideProps() in Nextjs?

Intro Basically, I am building an e-commerce website. But I got stuck in this problem while saving the order details after I click payment button (although I ha

How to avoid to write `@ApiProperty()` in each dto for NestJs-swagger

I'm researching the way on how to avoid to specify @ApiProperty() in each dto. I know there is exist a way to create file nest-cli.json, and if you specify Prom

Document.write is not working properly with media queries. What can I do - or is there an alternative?

This little function gives me a headache. document.write in combination with media queries just won't work responsive. I'm trying to change the css stylesheet w

How can i change Header Bar height in react native?

i'm trying to change Header Bar height in React-Native Stack Navigator this is my code I tried to put headerStyle: height:'100', but it doen't work what should

Save form values to localStorage

I have been studying JS for a while so at some point a couldn't complete the assignment that my teacher gave me so its all about to create a input to fill with

KeyIsDown does not seem to work with the right arrow

I'm writing a simple 2D platformer game on p5js, with Visual Studio Code 2022. I want to move this dinosaur sprite to the right and the left, however the keyIsD

I would like to check if the current time is before 11:00 with moment.js. How can I achieve this?

I'm working with the moment.js library, If I want to check if the current time is less than 11:00 or not How do I achieve this? let todaysDate = moment() // "y

Editing dropdown values without having to create a new dropdown every time

Within the code.org javascript editor for the applab, there is the ability to create a dropdown by creating a dropdown by: dropdown('id', 'option1', 'option2',

Going through each child in a div generated from API in javascript

I'm trying to access and delete the child in a div generated when I press the "submit" button, the individual divs inside will be generated because there are so

Checking instanceof with a class

I have the following code: function Complex(real, imaginary) { let c = Object.create(Complex.methods); [c.real, c.imaginary] = [real, imaginary];

react toastify does not work it gives a div as it output

**as you can see i am trying to show toast by using toastify and i install it but still it not working and it gives a div when it render** import React, { useR

Jest with TypeScript (Backend - Node/Express) says Cannot use import statement outside a module

I am working on Jest tests for a Node/Express TypeScript backend. I recently learnt about global test setup which I am implementing to reduce similar variables

Node JS: execution-time-wise, is generating array of promises and then using Promise.all better than looping and instantly awaiting every task?

Suppose we have an array of objects that we have to upload to a cloud service, the service will do something with each object and the return a result. The servi

How to use non-ascii characters in the regex filter of the declarativeNetRequest API for a Google Chrome extension?

I am creating a Chrome extension but just found out that it's not possible to use non-ascii characters in the regex filter of the declarativeNetRequest API. Whi

Make jQuery code run on page-change and load

I have a jquery code that inserts and prepends breadcrumbs on certain pages. I'm injecting this code through a third party tool where I can write JS. I only wan

Can't access multiple parameters of getStaticPaths from getStaticProps , Nextjs/Apollo/Graphql

Below you can check the code. I'm trying to use Id to identify single content and use titles for links, when I console log params.title console: android-pagin