arrays - 如何创建任何不同泛型的数组?
问题描述
我想创建类型必须相同的数组和数组。例如。
// Implements the type
[['foo', 'bar'], [null, null], [1, 2]]
// Doesn't implement the type
[[1, 'foo'], [true, undefined]]
这怎么能在 TypeScript 中完成?
解决方案
推荐阅读
- android - android.view.InflateException: Binary XML file line #132: Binary XML file line #132: Error inflating class Button
- django - 空 Django 表单选择字段
- c# - 无法让我的简单洛伦兹因子计算器处理小数。我错过了什么?
- angularjs - 使用 datetime-picker AngularJs 计算所选日期和当前日期之间的天数
- list - dart - 如果列表中包含,如何检查 id/name?
- javascript - 页面可在 Edge、Chrome 和 Firefox 中运行,但不适用于 IE11
- python - tkinter 中的 Python 多进程 - 在 Windows 中不起作用,但在 Linux 中不起作用
- shopify - 超过试用期后,控制不会重定向到付款页面
- reactjs - 如何将“用户名”作为道具从功能性无状态父级传递给功能性无状态子级到另一个有状态子级?
- jenkins-pipeline - 如果一个阶段或步骤也失败,则执行所有阶段和步骤