Category "javascript"

How do I record musical notes as they are played with the Web Audio and Media Recorder api's?

I'm trying to create a little app that records sounds from audio nodes as they are played using the Web Audio API, but have run into a few problems. I have two

How to implement unsigned right shift for BigInt in JavaScript?

I tried this sort of implementation, but it doesn't appear to be working. function urs32(n, amount) { const mask = (1 << (32 - amount)) - 1 return

Keep selected theme on page refresh using HTML, CSS and JavaScript

I would like to keep the selected theme when refreshing the page as well as across all other pages. I've seen other examples but I don't know how to implement i

Unexpected Jest Errors when Mocking Uppy

I'm attempting to mock the Uppy class from the uppy package in a Jest unit test following guidance from this previously answered question. My failing code is be

HTML-Table combine two filter scripts

I have two filters, one is a =>greater than or =<less than for one column and the other is a =>greater than and from an input box for a different colum

Create color palette from color

I have elements that should be colored by some color. However the bigger index of the element the 'lighter' shade of said color it should be, but never gray or

Behaviour of :defined pseudo selector class

I had a script as follows const custElem = document.createElement('my-elem') let res = custElem.matches(':defined'); console.log(`custElem.matches(':defined

My electron app that I packaged is not opening (I suspect it's a problem in package.json)

I can't open my electron app that I packaged , it created the folder release builds but I am not able to open the exe file it created. I suspect the problem is

How to generate ICS file for different calender's dynamically in reactJS

I have event data and I want user to be able to download ICS file and save it in calender of his choice This is the function I am using but the ics file generat

how to import and display 'svg' file in react native

I have an svg file: <svg xmlns="http://www.w3.org/2000/svg" width="260.346" height="65.709" viewBox="0 0 260.346 65.709"> <g id="logo" transform="tra

React toggle theme and save it to localStorage and also toggling classes to the html body tag

Please take a look at my code the toggle button is working completely fine but I also want to save the toggle state to localStorage I have tried it so many time

Creating a createSelector in Redux that does not rerender unrelated components

I have a simple document maker that allows users the create multiple fields of two types (input field and label field). They can also rearrange the field via dr

How do I understand this Recursion Base Code Problem

I'm learning the recursion concept in js, I got a very basic question of the base code returning problem. function factorial(n) { if (n === 1) { ret

Load a turbo frame with a select OnChange event?

I have a nested form where the nested form items are conditional on the selections in the main form. I have the nested part of the form in a turbo frame. I ha

How to get localdateTime format in JS

I'm using Vuejsto develop a project and I'm struggling to make my input type datetime get a min value . The min value has to be the value of the current Date an

How to a drop down-down menu list

I am trying to do a dropdown menu in javascript where get all states from a function and show in the drop down menu. But the code that I have so far is showing

Get interaction's reponse message object discord.js

Si I have this really simple command : let row = new Discord.MessageActionRow().addComponents(...) // The .. is too long so i'll just remove it for this questio

AppleScript For Multiple Safari Tabs And Mouse Click?

Complete noob to AppleScript here with a rather complex one: I would like automate a script that can do the following: After launching, waits for 61 minutes wit

Using JSDoc to set an index signature on an ES6 Class

In Typescript, you'd just do this: class Test { [key: string]: whatever } Which allows you to access computed property names like so... class Test { getPro

Vb.net code not performing as Javascript code

I translated a script from javascript that is correctly computing the APRs on mortgage loans into visual basic code which I'm trying to use on another site. I h