Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Object {
- let name: String
- let id: Int
- }
- let array = [
- Object(name: "obj1", id: 1),
- Object(name: "obj2", id: 2),
- Object(name: "obj3", id: 3)
- ]
- let vars = array.map(\.id)
Advertisement
Add Comment
Please, Sign In to add comment