Questions tagged as 'objeto'

4
answers

Help with object in js access properties

I usually access the properties of the objects like this: nombre = body.first_name; The problem is that the route I receive it by parameter. var ruta="first_name" and when putting nombre= body.ruta; tries to access the path proper...
asked by 11.07.2017 / 13:00
2
answers

Owned by a builder

The prototype of a constructor is a function. So, why in this case do you throw false ? function A() { this.n = 15; } A.prototype = {b: 2, c: 3}; Function.prototype.nn = 15; console.log(Object.getPrototypeOf(A)); co...
asked by 04.07.2017 / 15:37
1
answer

C ++ Can I declare an object of a class as a pair data type?

Can an object of a class be declared as a pair data type in C ++? I have been searching but I have not found much, I have tried to apply it in my code but it does not come out, eg: This is the code: char tag ='A'; point p(p....
asked by 11.11.2018 / 14:27
3
answers

How can I read a key that is formed by id _ name in javascript?

I try to read a variable from a json. But this variable has the following syntax. "id_nombre":{ Variables, } Looking at a serious example: 0_seccion:{ variables } My problem is that I do not know how to access this json. already try wi...
asked by 27.09.2018 / 21:00
5
answers

Swapping two objects by changing the result in JavaScript

I have two objects, and I want to return them permuted in JavaScript , that is, if I enter a and b as arguments, I return [b,a] , changing the order . But I do not want a function that only returns the permuted result, bu...
asked by 08.07.2017 / 02:38
1
answer

Create Javascript Object with Text String Templates

I wanted to know if I can define an object in javascript with the text string templates ('') and if so, what would be the correct syntax. I mean something like: var mi_objeto = '{prop: 1, atr: 2}';     
asked by 03.07.2017 / 11:02
1
answer

How to show the data of a List of Objects (collection) in C #?

They ask me to create a Race and an Athlete class, and show some data by console. In the Career Class I have to create a method that orders the contestants alphabetically. I tried to take the first and last, and it's all good. My problem is...
asked by 30.04.2018 / 06:24
2
answers

Error Syntax in Javascript eval

When trying to move from an object defined in backticks : var mi_objeto = '{propiedad1: 'a', propiedad2: 'b'}'; To a real object using the eval method: var objeto_real = eval(mi_objeto); I get a syntax error, which is fixe...
asked by 03.07.2017 / 19:49
1
answer

The operator is undefined for the argument type (s) Fraction, Fraction

A line of code (16) is giving me error where it tells me: The operator > is undefined for the argument type(s) Fraction, Fraction why can this happen? my code is: public class RekursionKlassen { public static void main(String[] a...
asked by 02.12.2018 / 21:00
2
answers

Remove duplicates of an array of JSON objects in javascript (Angular 5)

I am trying to eliminate the duplicate elements inside a json object that is in an array but I can not do it, try with filter and with map but it seems that I can not access the json object, that is, I refer to it, here I show a example of the a...
asked by 11.08.2018 / 18:31