Category "javascript"

p5.js returns UNDEFINED on this.instance_variable however, works when called explicitly. Please explain why. Example provided

I have read some stack overflow and all I was able to find was that "this" was not referencing the instance variable I had in question and that it was referenci

How can I change the inline javascript code to plain javascript code in the js file?

I am currently learning js and I'm making a chrome extension. After finishing the tutorial, I want to add more features for the extension. And I did it! You can

Chart Js - Limit points on graph without limiting data

I have a chart.js chart that needs to get plotted from a large number of points (say 1000). When I plot all these points it looks pretty bad, so I looked for a

Display the elements of the array one by one in a column js

I have an application where the user selects the words he will save. I write all these words into an array. I need to display each element of this array in a co

inverting object boolean property with ! vs =false , Is there any difference?

I am trying to make tic tac toe game in vanilla javascript. If I use ! to flip the value of object boolean property , it is changed to what it is defined in glo

Why do some images cause requestAnimationFrame() to lag/drop framerate?

Basically the title. I was creating a smoothly scrollable gallery with a bunch of images but I noticed a ton of lag. I was getting massive framerate drops/lag w

Browser address bar displays #[object%20Object] when clicking the menubar

I found that if I click one of the sections in menubar, the browser address bar displays #[object%20Object]. But it didn't influence scroll-to-section. Partial

Cloudflare KV namespace doesn't bind

Ran wrangler dev and it doesn't seem to bind Worker KV: ERROR in /src/handler.ts ./src/handler.ts 16:8-17 [tsl] ERROR in /src/handler.ts(16,9) TS2304: Can

How do I save data, that would normally be in a database, to a SharePoint folder or the site's root folder

I'm working on a project for my employer that is off-job-description for me. I am not in my department's IT/WebDev departments. That being said, my department i

Container is not defined problem in React

I'm trying to learn React but this 'Container' is not defined and I don't know why I got this error, even though I did everything in the course Here is App.js i

Discord JS - interactionCreate and messageCreate

I've been trying to use interactionCreate event, but somehow it's not working. I'm not sure why, and I didn't find exact documentation about this event, only th

Is there a way to having loading animation show until the page is fully loaded?

I have deployed my website on netlify but, the website displays only HTML until it finishes loading... Any tips on a way to make the website only show once it h

A function to obtain all leaf node properties of an object in an array of string in javascript

Request you to please help in building a function in javascript to obtain the mentioned output from the input given. INPUT : An object (possibly a nested object

Convert into DateTime format ISO8601

I am receiving the input date as below. 2022-05-05 18:08:13.311951 +0:00 And I am trying to convert this to below format which follows ISO8601 format. 2022-05-

The value is undefined. (Discord.js newest version and Node.js)

I have spent like 2 hours trying to debug this and I don't know what to do. I get the following error: connection.destroy ^ TypeError: Cannot read properties of

How to make Phaser3 GlowFilterPostFx work in an ES6 project?

I'm trying to apply a dynamic glow effect to some of my Phaser3 game objects. There's no built-in glow effect, but the framework author publishes a separate pac

"SyntaxError: Unexpected token < in JSON at position 0"

In a React app component which handles Facebook-like content feeds, I am running into an error: Feed.js:94 undefined "parsererror" "SyntaxError: Unexpected

Why does my D3 code break when I set the script type to module?

I am working on a project built with Javascrpt, jQuery, and Vite.js. My colleague built a data visualization using D3 - a US states map - that I need to implem

web3 JS payment button for Metamask BSC bep20 token

I would like to accept donations from visitors, I only want an specific token with pre set amount and only people with metamask. if (typeof window.ethereum !==

loop through array issue

I am calling an API that returns an array, i am trying to loop through the array but console is saying that the lenght is 0, never seen anything like it before