lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2k stars 43 forks source link

Console behaves different. #591

Closed azharweb90 closed 8 months ago

azharweb90 commented 8 months ago

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);`

btecu commented 8 months ago

Seems to be working fine. image

lukehaas commented 8 months ago

@azharweb90 if you're expecting the output to appear in a particular order, please read this: https://github.com/lukehaas/RunJS/issues/497

azharweb90 commented 8 months ago

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
lukehaas commented 8 months ago

@azharweb90 the output is aligned to the source because you have the 'Match Lines' option turned on. Please read this: https://github.com/lukehaas/RunJS/issues/497

azharweb90 commented 8 months ago

Thanks @lukehaas.