jsfiddle-console example
https://github.com/eu81273/jsfiddle-console
by nimishgoel056
HTML
<script src="https://cdn.jsdelivr.net/gh/eu81273/jsfiddle-console/console.js"></script>
JavaScript
function withdraw(amount) {
// coding and coding..
let amtArray = [100, 50, 20];
let notes = [];
if(amount >= 40 && amount <= 1000) {
for (let i = 0; i < amtArray.length; i++) {
debugger;
if(amount >= amtArray[i])
{let abc = Math.floor(amount/ amtArray[i]);
notes.push(abc);
// Get the new total
// amount = amount % amtArray[i];
amount = amount - abc*amtArray[i] ;
}
}
return notes;
}
}
withdraw(260);