Online JavaScript Formatter is a useful tool that allows you to edit, view, and analyze JavaScript data, as well as beautify and format it. With this tool, you can easily edit your JavaScript code and share it with others in a simple and straightforward manner.
Online JavaScript Beautifier - JavaScript Formatter Example
Before
constnumbers=[1,2,3,4,5];lettotal=0;for(leti=0;i<numbers.length;i++){total+=numbers[i];}if(total%2===0){console.log(`Thesumofthenumbersiseven:`);}else{console.log(`Thesumofthenumbersisodd:`);}
After
constnumbers = [1, 2, 3, 4, 5];
lettotal = 0;
for (leti = 0; i < numbers.length; i++) {
total += numbers[i];
}
if (total % 2 === 0) {
console.log(`Thesumofthenumbersiseven:`);
} else {
console.log(`Thesumofthenumbersisodd:`);
}