Menu
CoddyTech
Course

TypeScript for Kotlin Developers

Learn JavaScript runtime semantics and TypeScript structural contracts from Kotlin. Practice flow, functions, collections and class modules, then build a validated order-processing tool.

Kotlin and TypeScript side by side

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

  1. Run TypeScript

    Kotlin and TypeScript both allow top-level functions, but this Kotlin reference targets the JVM while TypeScript emits JavaScript for Node. TypeScript annotations disappear before execution. No JavaScript prerequisite is assumed: the early lessons teach its…

    Kotlin
    1import java.util.Locale2
    3fun main() {4val name: String = "Ada"5println("Hello, $name!")6}
    TypeScript
    1const name: string = "Ada";2console.log(`Hello, ${name}!`);
  2. Numbers and Conversion

    Kotlin toInt throws and toIntOrNull returns null for invalid integer text. JavaScript Number accepts decimals and exponent notation, yields NaN for bad text, and converts blanks to zero. Validate blank input and finiteness before arithmetic; an annotation…

    Kotlin
    1import java.util.Locale2
    3fun main() {4println("12".toInt() + 3)5}
    TypeScript
    1const value: number = Number("12");2console.log(value + 3);
  3. Arrays and Slice

    Kotlin lists have bounds checks and offer getOrNull for safe access. JavaScript array bracket access returns undefined when missing. Slice is a shallow copy with an exclusive end and negative offsets; splice modifies the source. A JavaScript array is…

    Kotlin
    1import java.util.Locale2
    3fun main() {4val values = listOf(1, 2, 3, 4)5println(values.drop(1).dropLast(1))6}
    TypeScript
    1const values: number[] = [1, 2, 3, 4];2console.log(JSON.stringify(values.slice(1, -1)));
  4. For-of and Array Values

    Kotlin for-in is a value loop, but JavaScript for-in enumerates keys. Translate to for-of. Recommended TypeScript uses let for a reassigned accumulator and const for each iteration binding. Both languages allow braces and block-local declarations. JavaScript…

    Kotlin
    1import java.util.Locale2
    3fun main() {4var total = 05for (value in listOf(3, -1, 2)) { if (value > 0) total += value }6println(total)7}
    TypeScript
    1let total: number = 0;2for (const value of [3, -1, 2]) { if (value > 0) total += value; }3console.log(total);
  5. Truthiness Is Not Emptiness

    Kotlin requires an explicit Boolean condition, so a list cannot be used directly in if. JavaScript permits an array as a condition and empty arrays are truthy. The source explicitly asks for non-emptiness and prints false, while Boolean([]) in the target…

    Kotlin
    1import java.util.Locale2
    3fun main() {4val values = emptyList<Int>()5println(values.isNotEmpty())6}
    TypeScript
    1const value: unknown = [];2console.log(Boolean(value));
  6. Annotations and Inference

    Kotlin distinguishes Int, Long and Double; TypeScript number uses JavaScript binary floating-point arithmetic for both whole and fractional numbers. A number annotation does not request Int overflow or integer division. Kotlin displays this Double as 10.0…

    Kotlin
    1import java.util.Locale2
    3fun main() {4val price: Double = 2.55val count: Int = 46println(price * count)7}
    TypeScript
    1const price: number = 2.5;2const count = 4;3console.log(price * count);

Syllabus

12 chapters48 lessons1 project48 challenges96 quiz questions

Start Here

1 lesson

Final Challenges

2 lessons

More courses for Kotlin developers

Learn TypeScript from another language

Frequently asked questions

Who is TypeScript for Kotlin Developers for?

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

Do I need to know TypeScript already?

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

How many lessons does TypeScript for Kotlin Developers have?

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

What does TypeScript for Kotlin Developers cover?

The course is organized into chapters covering: Start Here, Runtime Values, Runtime Collections, Runtime Control Flow, and more.

Is TypeScript for Kotlin 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 TypeScript for Kotlin Developers for free

Get started