Questions tagged as 'funções'

6
answers

How to put default arguments (default) in a JavaScript function?

In R this would be very simple: funcao <- function(x=10) return(x) If you call funcao() without arguments, the result will be 10 . How to do the same in JavaScript? And how do I know if there are default values in...
asked by 09.05.2014 / 17:28
3
answers

When to use recursion and when to use loops?

A problem can be solved and get the same result as a loop or through Recursive calls to a function.
asked by 16.06.2014 / 19:13
3
answers

Should we validate function parameters?

In languages like Java, the method parameters are "validated" in the compilation (at least the type): public void facaAlgo(String str) { // ... } // em algum outro lugar: int i = 2; this.facaAlgo(i); // erro de compilação! In dynamic typ...
asked by 02.12.2014 / 12:46