How to add an element into an array?



How to add an element into an array?..

Answer / Kiran Kumar

To add an element into an array in Swift, you can use the append(_:) method, like so:
let myArray = [1, 2, 3]
myArray.append(4)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apple iOS Swift Interview Questions

What is a guard statement?

1 Answers  


How to add an element into an array?

1 Answers  


What is difference between any and anyobject in swift?

1 Answers  


What is static in swift?

1 Answers  


How to create a tuple in swift?

1 Answers  


What is observer in swift?

1 Answers  


Should I use struct or class swift?

1 Answers  


Is swift faster than java?

1 Answers  


Can you explain any three-shift pattern matching techniques?

1 Answers  


How is swift different from objective-c?

1 Answers  


Mention some advantages of swift?

1 Answers  


Is "swift" a good programming language? Explain

1 Answers  


Categories