📘 Premium Read: Access my best content on Medium member-only articles — deep dives into Java, Spring Boot, Microservices, backend architecture, interview preparation, career advice, and industry-standard best practices.
🎓 Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (176K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
- Using slice() method
- Using Es6 spread operator (…)
1. Using slice() method
const users = ['ramesh','tony','stark', 'vijay', 'prabhas'];
const users1 = users.slice() // creates the copy
console.log(users1);
["ramesh", "tony", "stark", "vijay", "prabhas"]
2. Using Es6 spread operator (…)
const users = ['ramesh','tony','stark', 'vijay', 'prabhas'];
const users1 = [...users] // creates the copy
console.log(users1);
["ramesh", "tony", "stark", "vijay", "prabhas"]
Comments
Post a Comment
Leave Comment