Questions tagged as 'escopo'

1
answer

This outside-expected parameter within an anonymous function

I made a code to train Arrays and JavaScript manipulation. Here's part of the code: function Playlist (nome ='Playlist'){ const musicas = []; function addMusicas(...novasMusicas){ novasMusicas.forEach(function(musica){...
asked by 15.12.2018 / 16:00
2
answers

Is it possible to force one method to be called by another in a specific one?

I have a parent method that calls a child method, I wish the child method could only be called exclusively by the parent method, would it be possible? Example: public void MetodoPai(){ //codigo MetodoFilho(); //codigo } void M...
asked by 25.04.2018 / 16:28
1
answer

Scope of PHP variable

So, I've been banging my head for some time now with a basic scope question, but I could not figure out why. In the function below, I'm trying to access a position of the object that is running at the time of Foreach, though it is giving the...
asked by 22.11.2018 / 13:16
1
answer

Wrong Output in C

I'm doing an activity and the result is giving values that I do not assign anywhere in the code. int main(){ int numeroDePessoas = 0, tarefa = 0; scanf("%d %d", &tarefa, &numeroDePessoas); float passageiros[numeroDePessoas][5]; for...
asked by 23.04.2018 / 02:10
1
answer

Scope of service-worker?

I'm working on a PWA and would like to know if the scope or directory where the service-worker file is located might interfere with, for example, push notifications. Does a file within /statics/sw.js work in the same way as one that is...
asked by 17.04.2018 / 15:50
1
answer

Detect if inside callback?

I basically want a function to behave differently if it's inside a callback. See the example: import Test from './test ;' Test.say('Olá!'); // Deve imprimir: "Olá!" Test.group(() => { Test.say('Ei!'); // Deve imprimir: "Ei! - Dentro do...
asked by 12.04.2018 / 23:42
1
answer

When I squeeze in html the rating always shows undefined, but when I squeeze in the console it brings the response of the variable _class can anyone help me?

<script type="text/javascript"> //função que calculao IMC do paciente. function CalcImc(peso,altura){ var imc = p/(a*a); return imc; } //Entrada de dados e declaração de variaveis. var...
asked by 13.12.2018 / 15:33