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.
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…
Kotlin1import java.util.Locale2 3fun main() {4val name: String = "Ada"5println("Hello, $name!")6}TypeScript1const name: string = "Ada";2console.log(`Hello, ${name}!`);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…
Kotlin1import java.util.Locale2 3fun main() {4println("12".toInt() + 3)5}TypeScript1const value: number = Number("12");2console.log(value + 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…
Kotlin1import java.util.Locale2 3fun main() {4val values = listOf(1, 2, 3, 4)5println(values.drop(1).dropLast(1))6}TypeScript1const values: number[] = [1, 2, 3, 4];2console.log(JSON.stringify(values.slice(1, -1)));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…
Kotlin1import java.util.Locale2 3fun main() {4var total = 05for (value in listOf(3, -1, 2)) { if (value > 0) total += value }6println(total)7}TypeScript1let total: number = 0;2for (const value of [3, -1, 2]) { if (value > 0) total += value; }3console.log(total);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…
Kotlin1import java.util.Locale2 3fun main() {4val values = emptyList<Int>()5println(values.isNotEmpty())6}TypeScript1const value: unknown = [];2console.log(Boolean(value));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…
Kotlin1import java.util.Locale2 3fun main() {4val price: Double = 2.55val count: Int = 46println(price * count)7}TypeScript1const price: number = 2.5;2const count = 4;3console.log(price * count);
Syllabus
12 chapters48 lessons1 project48 challenges96 quiz questionsStart Here
1 lessonRuntime Values
4 lessonsRuntime Collections
4 lessonsRuntime Control Flow
4 lessonsRuntime Edge Cases
4 lessonsTyped Contracts
5 lessonsTyped Flow
5 lessonsTyped Functions
5 lessonsTyped Collections
5 lessonsReliable Modules and Objects
5 lessonsProject: Typed Orders
4 lessonsFinal Challenges
2 lessonsFrequently 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.