Category "javascript"

How to specify maximum number of words OpenAI completion should return

How can I specify the number of words the Open AI completion should return? E.g imagine I ask the AI the question Who is Elon Musk? What parameter can I use t

Click <select> and <input> after page load

I am writing a Greasemonkey script to interact with orders on Shipstation.com. The script will select certain values in <select> and <input> element

Scroll to the last item of a mapped array

I have a Message component that displays all the messages(incoming and outgoing) in one thread. I would like the last message/a newly typed message/incoming mes

How to fetch multiple .json files with javascript?

I have multiple .json files and I want to fetch them so I can take information from them. Like user ID, name, salary... I know how to do one, but I need two of

Using ref with React.createElement

I've got a reusable heading component that allows me to pass a tag prop, creating any sort of heading (h1, h2, h3 etc). Here's that component: heading.tsx impor

How to make my Discord.js bot that leaves servers below a certain member count

I am making a discord.js bot and trying to get it verified! I want to make it so when you add it to a server and it has below 35 members it leaves it. This is s

Handling Promise rejection with catch while using await

I am using await to make the code cleaner, but I am not sure whether I am handling exceptions correctly. An example while using azure-devops-node-api; const foo

Dynamically access Vue component data variable names

edit: I have used a number in this example which was a bad idea, in the real program I'm not using numbers but names (eg name_abba, name_jef, name_john) I have

Web3Modal Injected Provider not showing in options

I have a problem using Web3Modal, the connect panel doesn't show the metamask provider. Here is the code: const providerOptions = { injected: {

How to open a select dropdown on hover using Bootstrap Vue

I need a way to trigger the <select> or <b-form-select> and display the list of dropdown options on mouse hover. Without using JQuery or any externa

Javascript Remove Negative Decimal Value From String

I am trying to remove the negative and positive decimal value from the string following script remove the positive decimal value from the string however negativ

JSDoc nested types not showing on VSCode

I have this code: typedefs.js /** * A UUID. * Example: 123e4567-e89b-12d3-a456-426655540000 * * @typedef {string} uuid */ /** * @typedef {Object} Notific

Image path URL not Rending right in google apps script

I am trying to build an web app using apps script it was working well till yesterday but I don't know why my password recovery pages not rendering right. the im

What is regex for square bracket character in javascript [closed]

Can anyone tell me how to make regex for square brackets ( [ ] ) in JavaScript?

ReactJS and Azure library problem with displaying certain elements

so I'm doing a school project where I'm trying to fetch data from my Azure blob-storage and then displaying it on a website which is creating in ReactJS. I've m

WebRTC Perfect Negotiation Vue 2

I'm implementing WebRTC Perfect Negotiation in my Vue 2 application. The app will have multiple viewers and a single streamer. After a lot of logging and debugg

Shuffle multiple arrays in the same way but with Lodash

I've got two arrays const mp3 = ['sing.mp3','song.mp3','tune.mp3','jam.mp3',etc]; const ogg = ['sing.ogg','song.ogg','tune.ogg','jam.ogg',etc]; I need to shuff

Drawing a smooth line in p5js

I have a function that I created which draws a line from the coordinates of its first argument to the coordinates of the second argument. The code runs the func

Warning: Function components cannot be given refs

I'm using Next.js latest version for making my blog website, don't know why show me error, when I'm trying to make my form then show me error like this: Warning

Cannot find module '/home/container/node_modules/sqlite3/lib/binding/napi-v3-linux-x64/node_sqlite3.node'

Everything's running perfectly throught cmd on my pc but when i host it on my host servers i have this error: `:/home/container$ npm start knexfile.js Starting