Warm-up Challenges
The warm-up challenge introduces you to how Type Challenges work. You’ll learn the basic format and testing approach used throughout all challenges.This is the perfect starting point if you’re new to Type Challenges. It explains the testing methodology and gets you comfortable with the format.
Challenge List
#13 - Hello World
Your first Type Challenge - learn how the testing system works
Challenge: Hello World
#13 - Hello World
#13 - Hello World
Description
In Type Challenges, we use the type system itself to do the assertion. For this challenge, you will need to change the following code to make the tests pass (no type check errors).Starting Code
Test Cases
Expected Solution
Replaceany with the correct type to make HelloWorld equal to string.What You’ll Learn
- How Type Challenges uses compile-time assertions
- The
ExpectandEqualtesting utilities - Basic type assignment in TypeScript
Try It Yourself
Take the Challenge
Open this challenge in the TypeScript Playground
Understanding the Test System
Type Challenges uses a unique testing approach:How Tests Work
Equal<X, Y>: Returnstrueif types X and Y are identical,falseotherwiseExpect<T>: Only acceptstrue, causing a type error if the test fails
Example Test
Tips for Warm-up
Don't overthink it
Don't overthink it
The Hello World challenge is intentionally simple. The goal is to understand the testing format, not to solve a complex problem.
Read the test cases carefully
Read the test cases carefully
The test cases tell you exactly what type your solution should produce. In this case,
HelloWorld must equal string.Use the TypeScript Playground
Use the TypeScript Playground
Click “Take the Challenge” to open the problem in the TypeScript Playground where you can test your solution interactively.
Check for type errors
Check for type errors
Your solution is correct when there are no red underlines or type errors in the editor.
Key Concepts
Type Aliases
Type aliases let you create named types:Type Equality
In TypeScript, these are equivalent:Why Not any?
The any type opts out of type checking:
Next Steps
Once you’ve completed the warm-up, you’re ready to move on to:Easy Challenges
13 challenges covering fundamental type operations
Back to Overview
Review the challenge system overview
Additional Resources
TypeScript Basics
Learn about everyday types in TypeScript