January 2018
Intermediate to advanced
434 pages
14h 1m
English
Follow the mentioned steps to understand how to create a chain of multiple lets:
if(variableA!=null){ if(variableB!=null){ if(variableC!=null){ // do something. } }}
fun <T1: Any, T2: Any,T3:Any, R: Any> multiLet(p1: T1?, p2: T2?,p3:T3?, block: (T1, T2,T3)->R?): R? { return if (p1 != null && p2 != null &&p3!=null) block(p1, p2,p3) else null}
Read now
Unlock full access