Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const fullName = {
first: 'Akash',
last: 'Rajvanshi',
set full(name) {
const parts = name.split(' ')
this.first = parts[0]
this.last = parts[1]
fullName.full = 'Aakash Rajvanshi';
console.log(fullName.first) // Aakash
console.log(fullName.last) // Rajvanshi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.