Join Slack
Powered by
``` val<T> List<T>.head: T get()= ...
# getting-started
s
stephan_marshay
11/28/2018, 4:49 PM
Copy code
val<T> List<T>.head: T get()= this[0]
👍 2
n
Narayan Iyer
11/28/2018, 4:50 PM
This would be like adding this to the List class ... is my understanding correct?
s
stephan_marshay
11/28/2018, 4:52 PM
It's an extension function, so yes it "virtually" would (in practice, this is translated into a static method)
n
Narayan Iyer
11/28/2018, 4:52 PM
👍
h
hho
11/28/2018, 4:52 PM
It's an extension property
s
stephan_marshay
11/28/2018, 4:53 PM
Hah, correct, my bad
Open in Slack
Previous
Next