const str = "hello";
const charArray = [...str];
console.log(charArray.reverse()); // Output: ["h", "e", "l", "l", "o"]
const person = {
firstName: "Alice",
lastName: "Smith",
fullName: function(firstName, lastName) {
if(firstName !== undefined && lastName !== undefined){
return firstName + ' ' + lastName;
}
else{
return this.firstName + " " + this.lastName;
}
}
};
const anotherPerson = {
firstName: "Bob",
lastName: "Brown"
};
// console.log(person.fullName.apply(anotherPerson)); // Output: "Bob Brown"
// console.log(person.fullName('Asep',''))
console.log(Object.values(person))