Original code:
public class Subscription { public var type: String public var user: User? public init(type: String, user: User? = nil) { self.type = type self.user = user } } public class User { public var name: String public var subscriptions: Array
public init(name: String) { self.name = name self.subscriptions = [] } } #if !RunTests var usr = User(name: "John Doe") var sub = Subscription(type: "Cellphone", user: usr) usr.subscriptions.append(sub) print(usr) #endif
Dashboard
Start Trial
Sign In
Home
Product
Features
Use Cases
Customers
ROI Calculator
Integrations
Assessments
Tests
Questions
Pricing
Resources
Book: Evidence-Based Hiring
Blog
Support
Contact Us
Legal
For Jobseekers
© TestDome, 2024.