Questions tagged as 'javascript'

2
answers

Unexpected execution of setTimeout Javascript

For the following instruction: for(var i = 0; i<3; i++){ alert("Primero->"+i); setTimeout(function() { alert("Segundo->"+i); }, (i+1)*600); } The output is as follows:    First-> 0       First - >...
asked by 23.10.2016 / 12:54
3
answers

popup window with a video in browser

I am developing a web page and there is a request that I have from the client and I do not know how to carry it out. My idea is that as soon as you enter the index, a video appears in a pop-up window (advertising) and when this video ends, th...
asked by 27.10.2016 / 13:18
2
answers

javascript string.indexOf (array) does not work with long strings

I was looking for a good time but all the questions were different from mine. I'm trying to find a string in an array where the strings within the array contain more than one word, for example: var array = ["hola soy un string", " asd hola...
asked by 09.11.2016 / 10:50
2
answers

Obtain 5 last values of an array in javascript?

I have an array: aNumeros=[1, 5, 6, 7, 8, 9, 10, 12]; I want to create another array from that, which contains the last 5 numbers: aNuevo= [7, 8, 9, 10, 12] thanks in advance     
asked by 09.11.2018 / 22:27
2
answers

Is it possible to find a Date value within an array?

Good afternoon, my query is if I have a value type Date and an array where its values are also type Date : is it possible to perform a search to see if there are matches? . I'm doing the following: // time = Sun Dec 13 2015 21...
asked by 18.12.2015 / 19:33
2
answers

Do you doubt about how to create a loop in javascript to execute a game with canvas?

According to your experience, you can suggest some method of being able to maintain an execution loop to keep the logic of an application of a videogame in javascript, I am doing the part of the render with canvas to draw. I'm currently using...
asked by 06.06.2016 / 22:05
2
answers

Run background script

I'm doing a process with nodejs and I need to run say at every hour without needing to continually do something like node app.js . The script could have for example a console.log('ejecutar a cada hora') . Now, I was thinking a...
asked by 15.01.2016 / 21:23
3
answers

Browse Json array in Angularjs

I would like to know how to obtain the parallels of each subject in angular js. So far I can get the name but not its parallel Could You Help Me? I have the following JSON: [ { "num": "125", "nom_coe": "Matematicas", "variacion"...
asked by 26.02.2016 / 00:20
3
answers

Import modules in JavaScript

I'm trying to import a module into JavaScript. In python , because it's simple, you just import what you want with import . In javascript apparently also seems simple. In my case, I'm trying to implement the example that co...
asked by 05.02.2016 / 03:07
1
answer

What is the typeof of 0?

I'm doing a function that extracts all the numbers from one array and stores them in another, but when I get to 0 it does not recognize it as a number, here my code: function filter_list(l) { return l.filter(function(e){ if(typeof e ==...
asked by 30.08.2018 / 13:51