Js snippets

amount
	.toFixed(2)
    .toString()
    .replace(/\B(?=(\d{3})+(?!\d))/g, ",")
    
// or

amount
	.toLocaleString('en-US', { style: 'currency', currency: 'USD' });
var fs = require('fs');

fs.createReadStream('test.log').pipe(fs.createWriteStream('newLog.log'));
var t0 = performance.now();

for (let i = 0; i < 10000; i++) {   
    // Do stuff here 
}  

// Do some other stuff here

var t1 = performance.now();
console.log("Call to doSomething took " + (t1 - t0) + " ms.")

Similiar Collections