never datatype typescript code example
Example: never data type in typescript
function infiniteLoop(): never {
while (true) {
}
return 'this will never execute';
}
function infiniteLoop(): never {
while (true) {
}
return 'this will never execute';
}