How do you add an element to an array? const companies: string[] = ["Apple", "Amazon", "Meta", "Google"]; Let's say we want to add "Microsoft" to the above array. We can use the push() method which adds a new item to the end of the array. companies....
Markdown supported · ⌘↵ to post
No responses yet.