Questions tagged as 'javascript'

2
answers

How to get number of vowels in JavaScript [closed]

How can I get the number of uppercase and lowercase vowels in a variable in JavaScript. var person = new Object(); person = prompt("Introduce tus datos"); //Numero de vocales var numVocales; for (i = 0...
asked by 18.10.2017 / 16:18
2
answers

How the operator works || in this case?

This code apparently checks if a variable is true, and if not, creates the variable: (function(a){ a || (a = "Default value"); })(); Why does it only work when the defect is made with parentheses? , I mean: (a = "Default value") Also,...
asked by 15.12.2017 / 04:21
4
answers

Count Within an Array

I want to tell only one type of product, which is the best way to do it, Example I want you to print the number of "ORANGE" = 2 and not the whole array: var fruits = ["Banana", "Orange", "Apple", "Mango","Orange"]; fruits.length; console.log...
asked by 30.07.2018 / 20:15
2
answers

Go through Object, filter by field and do javascript push

I have the following object, for example: { "name":"false", "var_RadiacionGlobalInt":true, "var_CO2InvVaisala":true, "var_RadiacionExt":false, "var_VVExt":false } I would need to go through that object and the elements that are true to add...
asked by 25.07.2018 / 20:38
2
answers

Doubt about Promises and async await?

I'm seeing the promises and async await in JavaScript. The syntax to generate both if I understand it and I can create them. What I do not understand is because we use async await if the promises are already created to generate asynchronous task...
asked by 17.10.2018 / 11:58
3
answers

How to make a bootstrap Collapse in html tables?

I would like to get this effect toggle bootstrap in a table, that is to say: get that effect of displacement up, but all I get is that it appears and disappears with a horrible effect. I leave you a bit of code: $(function ()...
asked by 05.10.2018 / 19:27
2
answers

Make a GET request with fetch

Hello recently I am learning to use fetch I found on the internet an api which offers me a random user service now I have been trying to make a simple request where I only return a JSON that contains female users, and from a specific country lik...
asked by 06.10.2018 / 04:41
1
answer

Export html to word

Hello, I am trying to export certain HTML elements to word to generate a report and the user to download the document. After doing some research and seeing the same question in The English forum I found with this answer:    just keep follow...
asked by 25.04.2017 / 08:43
2
answers

Know which date is higher in Javascript

I have 2 dates, one start and one end, I try to avoid that the start is greater than the end, apart from that I can not do it, I get rare years, days that are not ... etc. console.log("start ", m , d , y);...
asked by 07.11.2018 / 11:30
3
answers

Validation field input text - You must only accept numbers - Javascript

A field input in a form: <td align=right>Cod.Postal:</td><td align=left><input type="text" name="codigo" id="idcodigo" maxlength="5"></td> It should be possible to write only numbers (0-9). window....
asked by 16.05.2017 / 16:04