Agregar espacio en blanco a la izquierda de la cadena en JavaScript
function yelling(message){
try {
console.log(message.toUpperCase().repeat(3));
document.write(message.toUpperCase().repeat(3));
document.write('<br>');
} catch(e) {
console.log(e);
console.log("Pass a string only!");
document.write(e);
document.write('<br>')
document.write("Pass a string only!");
document.write('<br>')
}
}
//------ ADDING "WHITESPACE" ------
let pesan = 'Hello-Universe!'
let pesanTeriakTeriak = pesan.padStart(20, ' '); //--- adding whitespce to the left of the string
//------ Executing the Function "yelling" -------
yelling(pesanTeriakTeriak);
yelling(1243252364);
de saint croissant