Kotlin has this concept of infix functions, which means they are an extension function that has only 1 parameter and allows us to use them without the dot (.) operator and no parentheses (but you can also do it the normal way, if you want to).
Declare the infix function
infixfunInt.times(base:Int)=this*base
Example
funmain(args:Array<String>){println(10times5)// prints 50println(10.times(5))// also prints 50}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Kotlin has this concept of
infix
functions, which means they are an extension function that has only 1 parameter and allows us to use them without the dot (.) operator and no parentheses (but you can also do it the normal way, if you want to).Declare the
infix
functionExample