Category "javascript"

Struggling with an element in my Javascript code

I am to make a script that will ask the user to enter numbers until they type quit. I have this working, but I am struggling with the final element where I hav

JavaScript: Best way to add custom properties/methods to built-in objects (e.g. arrays)

It is known that you should not customize the built-in prototypes in JavaScript. But, what is the best way to add custom properties/methods to specific instance

javascript split array in two arrays

I am trying to split this array into two different arrays using the values inside the first array. This is my initial array: "carList": [ { "b

Popup which persists through page redirect Next.js (React)

I am using Next.js for one of the projects that I work on. I wonder if someone could help me with an advice on how to show a popup (popup component, I think it

JavaScript - How do I print an input inside an array? [closed]

I already tried many ways to solve this, but it always returns undefined. What should I do to solve this issue? function printThreeFavoriteCol

Laravel Livewire set is Removing Map Marker

I am using Laravel 8 with Livewire and am displaying a Mapbox map in my page. When I click on the map, I am getting the coordinates of the click and placing a m

How to invoke a lambda function in aws-sdk v3

How can I invoke a lambda function using Javascript (TypeScript) aws-sdk v3? I use the following code which does not seems to work: // the payload (input) to th

How to add an icon in password field to show & hide password in rails

My code: div.form-group.col-md-12 label =t('.password') = f.text_field :password, required: true,

How do I change the language of moment.js?

I am trying to change the language of the date which is being set by moment.js. The default one is English, but I want to set the German language. These is what

How to create text border radius without wrap view in React Native?

In React-Native, how do I set borderRadius to Text-components? I've tried using borderRadius in text stylesheet but it not work: import { formatPhone, mapNameWi

having issues adding functionality to skip, play and pause a react music player

Below is the code with the react component, there is functionality to the play and pause button also the ability to skip to the next track or previous track. Sc

My useState in React/NEXTjs is not appending the result from a socket.io event from the server, just overwriting it

Frameworks used: Next.js, Socket.io, React I am making a simple messaging app. I am basically just emitting a message someone types, sending that message to the

Understanding and updating the gun user alias system

On the gun alias system: Is it like a phone book (public key book) where every user could have a different name for each key? Is it stored in a user's user spac

eventlistener not functioning when post request is sent

I am trying to add a number indicator to my cart icon that will display the number of items added after the product has been saved to my database. <div class

VSC Default Directory for IntelliSense?

I use the code-runner extension in VSC to run untitled files on the fly, which is super helpful for quickly testing code snippets. Under the hood, the extension

GET json api data in datatable with axios and vuejs

I have a datatable and I want to pass the data according to the api that returns a json using findAll() from the sequelize.. But in console.log when I call the

Javascript: check multiple elements in array [closed]

I have an array: a=[10,11,12,13]. How can check elements from a[0] to a[2] if they >0 in the shortest way and don't use for loop? Does anyo

regular expression to match exactly 5 digits

testing= testing.match(/(\d{5})/g); I'm reading a full html into variable. From the variable, want to grab out all numbers with the pattern of exactly 5 digit

Style dd and dt tags with bootstrap

I created dt and dd tags in my javaScript. I also have some styling for them in my CSS file. But I am switching to bootstrap, how can I style them? const pr

How to use filter with two Observables and return only one in rxjs

I have a part of code that checks if two observables are up to date and returns the second observable if they are: combineLatest([$source1, $source2]).pipe( f