Category : return-value

This is my code, I’m trying to return entries as a return-value for listDir to get it from outside, but it’s not working. function listDir(path){ var files; window.resolveLocalFileSystemURL(path, function (fileSystem) { let _this = this; var reader = fileSystem.createReader(); reader.readEntries( (entries) => { _this.files = entries; }, (err)=>(console.log(err)) ); },(err)=>(console.log(err)) ); return files; } What ..

Read more

const calcTempAmplitudeNew = function (t1, t2) { const temps = t1.concat(t2); // console.log(temps); return temps; if i return temps why function is not working?? let max = temps[0]; let min = temps[0]; for (let i = 0; i < temps.length; i++) { const curTemp = temps[i]; if (typeof curTemp !== ‘number’) continue; if (curTemp > ..

Read more

I need to detect changes on css, but I need style property (width. height, backgroundColor …, etc.) as a variable, meaning only the one that has changed. So I don’t need value. I need a style property in the form of a variable, for example in bold: document.getElementById (‘id1’). style.backgroundColor = ‘red’; document.getElementById (‘id1’). style.color ..

Read more

I would like to pass the optionValue and optionId variables in the jquery function; in this example the goal is to print the alert; some idea? it can be done? thank you function showOption(s) { var optionValue = s[s.selectedIndex].value; var optionId = s[s.selectedIndex].id; } $(document).ready(function () { $(“#salvaInput”).click(function () { if (confirm(‘Sei sicuro che vuoi ..

Read more

Working on a JavaScript Rock/Paper/Scissors game for a foundations Odin Project assignment that runs in the console. I made a function to compare playerSelection and computerSelection and determine win, lose, draw, or the playerSelection was not valid. The problem is, if for the playerSelection I input nonsense (i.e. asdf) It will correctly identify the input ..

Read more