Menu
CoddyTech
Course

Kotlin for TypeScript Developers

Move from TypeScript to Kotlin through null safety, collection ownership, functions, properties and object contracts. Build a connected multi-file order processor and port a stock ledger.

TypeScript and Kotlin side by side

The same program in TypeScript and in Kotlin, from the lessons of this course.

  1. Strings and Templates

    TypeScript template literals use backticks and braced dollar expressions. Kotlin uses templates inside ordinary double-quoted strings. TypeScript executes top-level module code, while Kotlin starts in a main function. Supporting Kotlin files compile together…

    TypeScript
    1const ready=3; console.log(`Ready: ${ready}`);
    Kotlin
    1fun main(){2val ready=33println("Ready: $ready")4}
  2. Equality and Identity

    TypeScript === avoids JavaScript coercive equality but compares object references. Kotlin == calls structural equality and === tests reference identity. Strings in both examples compare equal contents, yet arrays and ordinary objects need a separate policy. A…

    TypeScript
    1const a=String.fromCharCode(116,101,97); console.log(a === "tea");
    Kotlin
    1fun main(){2val a=String(charArrayOf('t','e','a'))3val b=String(charArrayOf('t','e','a'))4println(a==b)5}
  3. Arrays and IntArray

    TypeScript arrays are growable JavaScript arrays and may be sparse. Kotlin Array and IntArray have fixed sizes and checked indexes. A TypeScript numeric index can yield undefined outside the array, whereas Kotlin throws for an invalid array index. Choose…

    TypeScript
    1const values=[4,8,12]; console.log(values[values.length-1]);
    Kotlin
    1fun main(){2val a=intArrayOf(4,8,12)3println(a.last())4}
  4. While, Break, and Continue

    TypeScript and Kotlin both have break and continue, with different label syntax. TypeScript string comparison here uses strict equality; Kotlin string == compares contents without JavaScript coercion rules. The blank word is skipped, while STOP ends…

    TypeScript
    1const kept:string[]=[]; for(const word of ["tea","","STOP","coffee"]) { if(word==="STOP")break; if(word.length===0)continue; kept.push(word); } console.log(kept.join(","));
    Kotlin
    1fun main(){2val kept=mutableListOf<String>()3for(word in listOf("tea","","STOP","coffee")){if(word=="STOP")break;if(word.isEmpty())continue;kept.add(word)}4println(kept.joinToString(","))5}
  5. Top-level Functions

    TypeScript functions can exist at module scope and use arrow or declaration syntax. Kotlin also supports top-level functions, but its static parameter and return types are not erased JavaScript annotations. TypeScript overload declarations describe one…

    TypeScript
    1function isLong(text:string):boolean { return text.length>4; }2console.log(isLong("coffee"));
    Kotlin
    1fun isLong(text:String):Boolean = text.length>42fun main(){3println(isLong("coffee"))4}
  6. Input and String Formatting

    TypeScript trim and toUpperCase are JavaScript string operations, while Kotlin supplies JVM string APIs. Both string lengths use UTF-16 code units in these runtimes rather than grapheme counts. These demonstrations use ASCII to keep the displayed results…

    TypeScript
    1console.log("  tea  ".trim().toUpperCase());
    Kotlin
    1fun main(){2println("  tea  ".trim().uppercase(java.util.Locale.ROOT))3}

Syllabus

10 chapters48 lessons1 project48 challenges99 quiz questions

Final Challenges

2 lessons

More courses for TypeScript developers

Learn Kotlin from another language

Frequently asked questions

Who is Kotlin for TypeScript Developers for?

For people who already write TypeScript and want to learn Kotlin. Each lesson starts from TypeScript you know and shows how Kotlin does the same thing, so you skip the beginner basics.

Do I need to know Kotlin already?

No. The course starts with your first Kotlin program. You need TypeScript basics: variables, conditions, loops, functions and collections.

How many lessons does Kotlin for TypeScript Developers have?

Kotlin for TypeScript Developers contains 48 interactive lessons you can complete at your own pace.

What does Kotlin for TypeScript Developers cover?

The course is organized into chapters covering: Starting Kotlin, Values and Decisions, Collections and Ownership, Iteration and Transformations, and more.

Is Kotlin for TypeScript Developers free?

Yes. Every course on Coddy is free to start. You can complete lessons in your browser without any downloads or signup.

Coddy programming languages illustration

Start Kotlin for TypeScript Developers for free

Get started