Back to Type Challenges

README

questions/18142-medium-all/README.md

latest1.5 KB
Original Source
<!--info-header-start--><h1>All </h1><blockquote><p>by cutefcc <a href="https://github.com/cutefcc" target="_blank">@cutefcc</a></p></blockquote><p><a href="https://tsch.js.org/18142/play" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.zh-CN.md" target="_blank"></a> </p><!--info-header-end-->

Returns true if all elements of the list are equal to the second parameter passed in, false if there are any mismatches.

For example

ts
type Test1 = [1, 1, 1]
type Test2 = [1, 1, 2]

type Todo = All<Test1, 1> // should be same as true
type Todo2 = All<Test2, 1> // should be same as false
<!--info-footer-start-->

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