Questions tagged as 'function'

3
answers

Arguments in function (Javascript - ES5)

I have the following code: function leerTexto (nombre, callback) { process.nextTick(function () { var contenido = fs.readFileSync(nombre) callback(content.toString()) }) } Leaving aside what the code does, I would like to know why the...
asked by 05.03.2017 / 22:03
1
answer

Doubt with functions in javascript, react js

because when I put a function in this way, the this.state , is not bringing me the values that happened when I write in the input fnLogin(event){ debugger; event.preventDefault(); this.setState(obtenerToken(this.s...
asked by 16.11.2018 / 20:12
2
answers

Problems with use $ (document) .ready (function () {})

I'm starting with js and in practice this question arose: The script that I will show below works correctly. <script src="js/jquery-2.0.2.min.js"></script> <script> function accion(num){ if (num==1) {...
asked by 25.07.2017 / 20:32
2
answers

Problem repositioning img on canvas with keyListener

I'm trying to move wolf with the arrows on the keyboard, but I can not get more recharge the position of all animals, except the wolf, and what I want is to move the wolf with the arrow pointing up. I'll put the rest of the keys when I get them...
asked by 09.05.2018 / 20:09
2
answers

javascript function replace

From the following function, how do I substitute blank spaces with hyphens? <!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8" /> <title>Ej funciones</title> </head> <body> <script...
asked by 25.10.2018 / 18:21
2
answers

how to make a triangle with this symbol in python (*)?

1) My first problem is how to apply the math with the symbol (*) in str form. 2) My second problem is how do I make a triangle like this * ** *** **** ***** This is my code so far def triangulo(): simbolo='*' for i in range...
asked by 05.10.2018 / 06:14
1
answer

Take data out of a function

Good, I need to get the variable "users" of this function and the for loop, I thought about using promises but I'm new with that and I can not find the round var ids = [ "RtSG7NApoda9ycDRd7vm", "TnT9XOXnkD1Ra5ROJERR", "55fAOlOlej...
asked by 23.01.2018 / 22:04
0
answers

C ++ Map as function output in VBA

I have a C ++ code that returns a map to me. I have created a dll and I call it from an Excel macro. Then, in that macro, I need a dictionary (Scripting.Dictionary) . I tried to do the following: Declare Function ExlFunct Lib "dire...
asked by 26.04.2017 / 14:10
1
answer

How to move to a function for better organization in Python

Good I have several parts of code that I want to pass to functions and I need a brief explanation with an example of a portion of my code: from xlrd import open_workbook book = open_workbook("archivo.xlsx") for sheet in book.sheets(): for...
asked by 19.10.2018 / 22:32
1
answer

btn.eventListener is not a function!

When I want to add an event listener to an html object, the eventlistener is not a function error appears in the browser console, the code is as follows. This script is executed in a simple html file. var btn = document.getElementsByClassName(...
asked by 28.04.2018 / 23:30