Category "javascript"

How to dynamically assign properties and values to an object in Javascript

I am trying to assign properties and values to an object initialized as empty. However, it keeps on prompting the Error: Cannot assign properties of undefined (

How to dynamically assign properties and values to an object in Javascript

I am trying to assign properties and values to an object initialized as empty. However, it keeps on prompting the Error: Cannot assign properties of undefined (

How can you prevent the camera from colliding with ALL objects in the scene in threejs?

In threejs, I have made a scene using threejs editor. How can I prevent the camera from moving inside of the bounds of all of these objects? Eg scene = importwh

Make JSON.parse work for array of objects with quotation mark

I am trying to store an array of object as string and restore it later. However, some elements in the objects are string and they may have ' or ". This causes a

Différence between only one state for variables or state for every one in react

If i'm having 3 variables to handle with useState in react is doing this: const [ user , setUser ] = useState({ name : '', phone : '', age : '' }) setUser({...

pass parameters to a javascript function without using an inline function inside jsx

So after reading a few articles on react native performance, I realized that you're supposed to avoid arrow functions inside JSX. https://blog.codemagic.io/impr

Add new tag to the middle of element

I am trying to surround specific words in textContent with HTML tags, this could hypothetically be done by doing element.textContent = element.textContent.repla

Can you add apps made from (js, nodejs, express and mongodb) in a wordpress website?

I already have a wordpress website. I studied web development using js, node.js, express and mongodb and build some projects. I would like to add it to my websi

I'm trying to get the output from my model,but got 4 tensor.I dont know anything about these tensors

I'm trying to get the output from my model,but got 4 tensor.I dont know anything about these tensors i use the model to detect face. Here is my model enter imag

How can I create a menu with my json info with REACT

what I try to do is to have the same display as this picture : So in my menu the plant type (Type of plant1) is displayed above a gray bar and when you click o

Add new tag to the middle of element

I am trying to surround specific words in textContent with HTML tags, this could hypothetically be done by doing element.textContent = element.textContent.repla

Copy value of a local variable to a global variable [duplicate]

I have this variable declared in global scope: export class InboxmanagementComponent implements OnInit { statmentID: number; // global vari

Javascript request animation frame irregular translation

SO community! I'm trying to make an object move at the same phase as scroll using CSS transform. The problem is that I see the animation is not smooth. Instead,

Change a agSelectCellEditor drop down value using selenium

I am trying to access values in a drop down which when I inspect, nothing is been in element inspector. I confirmed with developer what type of drop down is tha

Does each element of an array get passed as the argument of the callback function when using map() and filter()? [duplicate]

I have basic knowledge about map() and filter() but I want to know a bit more. When using map() or filter() on an array, does each element of

Write a function which return the digits

Given a varying number of integer arguments, return the digits that are not present in any of them. Example: [12, 34, 56, 78] => "09" [2015, 8, 26] =&

React state returns undefined when passed as object value

I want my id to be increased every time this function is executed,but when I console the object id returns undefined let [count, setCount] = useState(0); c

Karma fails to load test file: "Failed to fetch dynamically imported module"

I'm trying to test my LitElement components with Karma but importing PDF.JS is causing the test file not to be loaded. Example of the LitElement component file

Sequelize scope on create

I am quite new to sequelize and trying to use it with sequelize-typescript. I have a user model like this: @Scopes(() => ({ authenticated: { attr

Decrement font-size on condition, why is my recursive function not working?

I have a <p> element inside a parent <div> container. The parent container is sized with width and height as a % of the viewport. Upon window-resize