Category "javascript"

Accessing values inside Objects

I am trying to print a 2d array of a schedule that is inputted to me via object. When it prints, it is not giving me the values I want. Any idea what i doing wr

Resize jQuery autocomplete UI according to the cursor position

I'm creating autocomplete feature for my own low level program executor.I need to get the autocomplete values near the alphabet typed like in VScode and other I

reactstrap typescript nx `Uncaught ReferenceError: global is not defined`

I'm using [email protected] with nx and typescript. But if any component is included from reactstrap the app is crashing with below error index.js:3 Uncaught Ref

How to make a class value reactive in React

I have a simple class, something like this: class ReallyHugeClass { constructor() { this.counter = 0; } increment = () => { this.counter += 1

Visual Studio Code | How to get Javascript class methods and variables to auto appear while coding in an HTML file

BACKGROUND Just in case this helps you understand the problem. I came from coding in XCode with swift, back to Visual Studio Code to work on some web developmen

Error with Typescript Pact.io test: PopsicleError: Unable to connect to

Expected: Running npm run pactTest should generate a pact file (JSON). Results: I get an Unable to connect error. Pact.io JavaScript implementation guide. Pa

How to group array or column based data by a specific item's/column's value while summing-up the values of another?

We are building an integration in a SAAS product which exports data from a table and writes it to a CSV file. Tool allows JavaScript (Which i am not very famili

NextJS - Appending a query param to a dynamic route

In my NextJS app, I have a language selector that's visible on every page. When I select a new language, I just want to replace the current URL by appending a q

Unable to update state while using React Native

I am trying to get to grips with the React hook useState. At the moment I am unable to update the state of my errors object, a little unsure of where I am going

Error text is cut off when generated to PDF in nuxt.js + @nuxtjs/tailwindcss

Error text is cut off when generated from HTML to PDF with Vue-html2pdf in Nuxt.js when use @nuxtjs/tailwindcss although when show layout then everything is nor

Filtering the Gatsby Slug in onCreateNode

I'm trying to filter the slug generated by Gatsby so I can remove white space and replace it with "-". I have Gatsby's reporter set to fire when onCreateNode is

Javascript remove background color and opacity

How can I remove the background-color and opacity property using Javascript only (no Jquery!). I tried this: document.getElementById('darkOverlay').style.remo

How to use peerjs (import and require both fail)

I want to use peerjs in a script (that I use in a html file). When I try import Peer from "peerjs", I get an error saying "Cannot use import statement outside a

How do I write my own `reduce` function?

I want write reduce by myself. But over the last 4 hours, I couldn't. var a = [10, 21, 13, 56]; function add(a, b) { return a + b } function foo(a, b) { retur

Flask server not starting for SocketIO

I am trying to make a chat app using SocketIO and following this video: https://www.youtube.com/watch?v=RdSrkkrj3l4 and the corresponding GitHub code: https://g

How to bind the dropdown lists based on selecting the items from the dropdowns

I have one dropdown which I have to show this dropdown from constant.ts file And In second dropdown I have to show the dropdown based on the selecting the first

Display alreat message if object value exist in array of object in javascript

I want to display alert message if user type name into input field and checks if the value is same as the object value present in the array of object. I'm using

codemirror.setOption('mode',val) isnt working

I am trying to make a text editor with firepad and codemirror, everything works perfectly on page loading, but when I try to change the mode on button click, th

React-router - How to pass data between pages in React?

I am working on a project where I have to pass data from one page to another. For example, I have data on the first page. let data = [ {id:1, name:'Ford', co

How to set a minimum date range limit for the Date Range Picker

I am using the Date Range Picker from daterangepicker.com. How can I set a minimum date range limit for this Date Range Picker? For example, I want to set minim