padStart get 'Turtle' with 10 spaces in front of it
padEnd get 'Turtle' with 10 spaces after it
const fun = (
a,
b,
c,
d,) => {
console.log(a);
}
fun(1,2,3,4,)
Everytime you add a new parameter, it's a lot easier.
'Object.keys' allowed us to do something similar to arrays but on objects.
let obj = {
username0: 'Santa',
username1: 'Rudolph',
username2: 'Mr.Grinch'
}
Object.keys(obj).forEach((key, index) => {
console.log(key, obj[key]);
})
Object.values(obj).forEach(value => {
console.log(value);
})
Object.entries(obj).forEach(value => {
console.log(value);
})
let obj = {
username0: 'Santa',
username1: 'Rudolph',
username2: 'Mr.Grinch'
}
Object.entries(obj).map(value => {
return value[1] + value[0].replace('username', '');
})