This is the final code:
var varone = 98
var vartwo = 25
var varthree = 9
var varfour = 36
const convertArray = {varone, vartwo, varthree, varfour};
console.log(convertArray)
const varEntries = Object.entries(convertArray);
varEntries.forEach(function ([key, value]) {
console.log(key, value);
if (value < 10) {
console.log(value = "0" + value);
console.log(key, value);
}
});
console.log("Values of original variables varone, vartwo, varthree, varfour are: " + varone+ "," , vartwo + "," , varthree + "," , varfour + "," );
The key value pairs in an array are updating, but the actual variable’s value is not updating, what should I do next so that the actual values of the original var/const gets updated.
Logic: A coming soon counter clock was build here. But the one with “1” numeric digit out of Days/Hours/Minutes/Second used to distort the CSS as compared to other which have “2” numeric digit. So I was planning to concatenat one “0”(to make one digit numeric two digit) as pointed by @Archibald in this discussion.