JavaScript at Method 😎😎😎 Check Description for full explanation javascriptdev
#############################
Video Source: www.youtube.com/watch?v=j5BPqc7cQnY
The at() method was recently added in JavaScript for Array instances that solves a very niche use case! • It acts almost like the array[index] syntax, except that the index can be negatively! • ✨ There are many interesting use cases for this! • 👉 If you want to get the last item in the array, instead of arr[arr.length - 1] you can simply do arr.at(-1) • 👉 When doing cyclic operations on array, such that the item previous to 0th index is the last item. (i - 1 cases where I could be 0) • Credit baby_wolf_codes • Do you have any use case for this? Let me know in the comments! • #javascript #js #programming #coding #developer #html #css • [ JavaScript, JavaScript at method, JavaScript string methods, JavaScript tutorial, JavaScript functions, reactjs, mern, js tricks , web development, frontend developer ]
#############################