lukehaas/RunJS

Console behaves different.

Closed this issue · 5 comments

I have created a function which simply generate tables and I'm expecting output with the lines of equal signs after each table. Code is working fine in different environment like jsfiddle but not in Run js.

`function generateTables(limit){

if(limit === undefined){
throw new Error("Arguments should not be empty!");
}
if(isNaN(limit)){
throw new Error("Please provide a limit to generate multiplication tables");
}
if(arguments.length !== 1){
throw new Error("You can provide only one argument max...!");
}

for(let i = 1; i <= limit; i++){
if(i > 1){
console.log('======================');
}
for(let j = 1; j <= 10; j++){
console.log(${i} * ${j} = ${i * j});
}
}

}

generateTables(2);`

Seems to be working fine.
image

@azharweb90 if you're expecting the output to appear in a particular order, please read this: #497

Same code I have, but you can see the output on my Runjs. Which version of RUN JS do you have ?

Screenshot 2023-11-06 at 6 39 56 PM

@azharweb90 the output is aligned to the source because you have the 'Match Lines' option turned on. Please read this: #497