mirror of
https://github.com/swc-project/swc.git
synced 2024-12-22 05:01:42 +03:00
18 lines
280 B
TypeScript
18 lines
280 B
TypeScript
const showValue = (v)=>{
|
|
if (v === 0) {
|
|
return showList([
|
|
v
|
|
]);
|
|
}
|
|
return `${v}`;
|
|
};
|
|
const showList = (v)=>{
|
|
return `[${v.map(showValue).join(', ')}]`;
|
|
};
|
|
console.log(showList([
|
|
1,
|
|
2,
|
|
3
|
|
]));
|
|
console.log(showValue, showList);
|