Category "object"

searching in arraylist always not found

no matter what I use indexof() or contains or .equals() changing everything to uppercase or to lowercase It always return false and not found can someone please

How to map more than one property from an array of objects

I have an array of Object as follows: var obj = [ {a: 1, b: 5, c: 9}, {a: 2, b: 6, c: 10}, {a: 3, b: 7, c: 11}, {a: 4, b: 8, c: 12} ]; I know about how

What is the most efficient way to deep clone an object in JavaScript?

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but that's non-standard and only sup

handle multiple checkboxes and complex data structure (reactjs)

Since I am pretty new to React and also not a huge expert on JS especially ES6, I wonder how to make my code (that works) prettier and refactor it. I want to h

Unable to retrieve the correct value from a list of object within object

I am quite new to javascript and I've been struggling with this type of challenge. I understand the problem and implement a logic to solve the issue but I am un

Unable to retrieve the correct value from a list of object within object

I am quite new to javascript and I've been struggling with this type of challenge. I understand the problem and implement a logic to solve the issue but I am un

JavaScript object assignment: unexpected behaviour

Suppose we have two objects: var a = { foo: { bar: 1 } } var b = { foo: { bar: 2 } } If I set the object b to a (a = b), I expect that a takes the value of b

Calling a native C++ method from C++/CLI

I'm developing Wordle in C++ using a .net graphic interface with visual studio. I have a file.h that contains a class "WordDatabase", and I need to use one of t

Modifying a copy of a JavaScript object is causing the original object to change

I am copying objA to objB const objA = { prop: 1 }, const objB = objA; objB.prop = 2; console.log(objA.prop); // logs 2 instead of 1 same problem for Arrays

How to check an empty object?

I have a number of objects. Some of them have string properties and some of them have bool properties. I'm using them in multi-step form. so each step is bound

Parse JSON String into a Particular Object Prototype in JavaScript

I know how to parse a JSON String and turn it into a JavaScript Object. You can use JSON.parse() in modern browsers (and IE9+). That's great, but how can I t

Is there a way to convert an Object[] array to char[] array?

class Solution { char[] make(String s){ Stack<Character> st= new Stack<Character>(); for(char c:s.toCharArray()){ if

How to loop and display array of objects and their nested arrays

I need help, I got stuck on objects with multiple nested arrays. I have a json file which consists of object, that holds array of objects, and these objects hav

Nested objects in response not logging to console

My server gets a response from another server with a document from a mongodb database with a body similar to { messageDetails: { body: "hello" }

Is there an Object spread syntax in python 2.7x like in Javascript?

How can I spread an objects/dict(?) properties and into a new object/dict? Simple Javascript: const obj = {x: '2', y: '1'} const thing = {...obj, x: '1'} // t

How to remove the first property of an object?

How do I remove the first property of an object like: var obj = { x:1, y:2, z:3 }; so that obj becomes: { y:2 , z:3 }; This approach doesn’t work

How to remove the first property of an object?

How do I remove the first property of an object like: var obj = { x:1, y:2, z:3 }; so that obj becomes: { y:2 , z:3 }; This approach doesn’t work

How to limit properties of a JSON object given array of property names using JQ?

Assuming I have the following JSON object (which is just an example): { "foo": 1, "bar": 2, "baz": 3 } And the following JSON array (another example)

How do I use a for loop to manage increments of an object property in JavaScript?

I’m doing a rockPaperScissors project. Here’s the published link: https://george-swift.github.io/rockPaperScissors/. I want to add a first to 5 feat

How do I convert a ZipFile object to an object supporting the buffer API?

I have a ZipFile object that I need to convert to an object that will work with the buffer api. Context is that I am trying to use an API that says it takes a f