Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
console.log(' hello '.trim()); // 'hello' console.log(' hello '.trimStart()); // 'hello ' console.log(' hello '.trimEnd()); // ' hello' console.log('5'.padStart(3, '0')); // '005' console.log('hi'.padEnd(6, '.')); // 'hi....' const hours = String(9).padStart(2, '0'); const mins = String(5).padStart(2, '0'); console.log(hours + ':' + mins); // 09:05 console.log('ha'.repeat(3)); // hahaha console.log('Hello World'.toLowerCase()); // hello world console.log('hello world'.toUpperCase()); // HELLO WORLD
Result
Open