keyof_operator.ts

TypeScriptIntermediate

Explorer

C40
C++40
C#40
Dart40
Go40
Java40
JavaScript40
Kotlin40
Objective-C40
Perl40
PHP40
Python40
R40
Ruby40
Rust40
Shell40
Swift40
TypeScript
Beginner10
Intermediate10
keyof_operator.ts
literal_types.ts
index_signature.ts
type_intersection.ts
generic_function.ts
type_guard.ts
interface_extends.ts
const_assertion.ts
mapped_type.ts
conditional_type.ts
Advanced10
Expert5
Master5
keyof_operator.ts
Click to focus
1
2
3
function getProperty<T, K extends keyof T>(obj: T, key: K) {
  return obj[key];
}
0WPM0%0:000/81(0%)|Ln 1, Col 1
UTF-8TypeScript

Related Exercises