Posts by Marcel Roberto Piesigilli • 49 points
4 posts
-
1
votes2
answers91
viewsQ: How to generate a 2d matrix with one of the positions chosen separately having a different value?
I want to generate a 10x10 matrix, where all elements will be "B", except one of the positions, which should be chosen randomly and have the value "8". var m = []; for(i=0; i < 10; i++){ m[i] =…
-
0
votes1
answer21
viewsQ: Display array indices whose elements are greater than the average of them
I have an array, and I want it to display the numerical positions of the elements that are larger than the average of them: //2 - Solicite 5 números. Exiba os que estão acima da média. var num,…
-
0
votes1
answer64
viewsQ: How to pass as two array as argument in a function?
var arr1 = [1, 2, 3]; var arr2 = [4, 5]; function mover (arg1,arg2){ return arg1 && arg2; } My question: Am I doing it right? Because I expected in the answer [1, 2, 3] , [4, 5], and as you…
javascriptasked Marcel Roberto Piesigilli 49 -
2
votes1
answer173
viewsQ: How to play a var inside Return?
function tamanhoNomeCompleto(a,b){ var tNC = a.length + " ".length + b.length; return tNC; } tamanhoNomeCompleto("Paulo","Paulada"); How do I put the tNC in the return? 'Cause I’m getting this:…