Questions tagged as 'javascript'

3
answers

Complicated with JS

I have a little problem with some things that I'm doing in js and that are not working well for me. The subject is like this: I have a select where the user chooses options: <select id="cobertura" name="cobertura"> <option value=""...
asked by 19.12.2017 / 18:20
2
answers

Difference between new Array () in ES5 and Array.of () in ES6 in JavaScript

When we use the Constructor new Array() in ES5 to build a new fix we do the following: EXAMPLE 1 let elementos = new Array(2); console.log(elementos[0]); console.log(elementos[1]); //ambos console darán undefined Howeve...
asked by 30.09.2018 / 02:01
1
answer

what is $ for? in JavaScript?

I've seen this% $ much in JavaScript libraries, for example: $.fn._fadeIn = $.fn.fadeIn;     
asked by 19.10.2017 / 18:15
4
answers

How can I make the first letters of the capitalized words appear?

The fact is that I have this code and it only converts the first letter. The fact is that I want you to convert the first letters of each word and I do not know how to do it. document.write("Nombre y apellidos<input type='text' id='dato...
asked by 21.10.2017 / 18:49
4
answers

How to decompose a return?

Suppose that the following return came from a function: return { x: 199, y: 200 } Eye: I can not change the return itself. How can I then from where I receive the return modify it? That is, for example: I got x:...
asked by 24.07.2017 / 02:20
3
answers

Use of td and tr mvc

How can I put the comma to the employee's salary or currency type this is the view @foreach (var item in Model)                 { <tr> <td>@item.EmpId</td> @*...
asked by 17.10.2018 / 17:44
2
answers

How to determine the sublevels of an array? Using a recursive function

I have a table in the database in which I keep all the functions of my menu, it has the following columns: table: functions / columns: id, father_id, icon, link, title And I want to order the parents and children as I have registered in th...
asked by 26.04.2017 / 21:01
2
answers

Access a property of a JSON

I have the following JSON "values": [ ["Martes", "pan", [8, [4],[0]], 7.381498329613434] ] } What would be the way to show the value: 7.381498329613434 in my Javascript console? Thank you very much     
asked by 07.11.2018 / 22:00
3
answers

Subtract dates in js [duplicate]

Hi, I would like to know how I can subtract two date objects. I have a variable date of birth and I want to subtract the current day in order to get the years of difference ... var f = new Date(); var xf = (f.getDate() + "...
asked by 09.04.2018 / 19:28
3
answers

Create TR table with automatic id Javascript

Hello, I have the following code: My idea is that when calling this function insert a row in a table and to operate on it put an id to the TR, which I generate with the variable counter, the problem is that I have assigned the id ... but it doe...
asked by 19.04.2018 / 09:27