Back to Type Challenges

README

questions/00529-medium-absolute/README.md

latest1.8 KB
Original Source
<!--info-header-start--><h1>Absolute </h1><blockquote><p>by Andrey Krasovsky <a href="https://github.com/bre30kra69cs" target="_blank">@bre30kra69cs</a></p></blockquote><p><a href="https://tsch.js.org/529/play" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.zh-CN.md" target="_blank"></a> <a href="./README.ja.md" target="_blank"></a> <a href="./README.ko.md" target="_blank"></a> </p><!--info-header-end-->

Implement the Absolute type. A type that take string, number or bigint. The output should be a positive number string

For example

ts
type Test = -100
type Result = Absolute<Test> // expected to be "100"
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/529/answer" target="_blank"></a> <a href="https://tsch.js.org/529/solutions" target="_blank"></a> <!--info-footer-end-->