00018-easy-tuple-length

Back

// your answers
type Length<T extends readonly any[]> = T['length'];

Solution by justBadProgrammer #36359

// 你的答案
type Length<T extends readonly any[]> = T['length']

Solution by ATravelerGo #36352

type Length<T extends readonly unknown[]> = T["length"]

Solution by asylbekduldiev #36331

type Length<T extends readonly any[]> = T['length'] 

Solution by 1Alex4949031 #36310

type Length<T> = T extends readonly any[] ? T['length'] : never

Solution by Jace254 #36267

type Length<T extends Readonly<Array<any>> > =  T['length']

Solution by Maxim-Do #36225

type Length<T extends readonly any[] > = T['length']

Solution by EvgeniyKoch #36194

type Length<T extends readonly string[]> = T['length']

Solution by tungulin #36155

type Length<T extends readonly string[]> = T['length']

Solution by AleksandrShcherbackov #36142

type Length<T extends readonly any[]> = T['length']

Solution by KimKyuHoi #36114

type Length<T extends readonly any[]> = T['length']

Solution by jhsung23 #36105

// your answers

Solution by Matteo9730 #36066

type Length<T extends readonly any[]> = T["length"]

Solution by karazyabko #36026

// your answers
type Length<T extends readonly any[]> = T['length'];

Solution by krokerdile #36004

type Length<T extends readonly any[]> = T extends readonly any[] ? T['length'] : never; 

Solution by codingaring #35927

// your answers

type Length<T extends readonly any[]> = T['length']

Solution by pytest5 #35922

// 你的答案
type Length<T extends readonly any[]> = T['length'];

Solution by reonce #35906

type Length<T extends readonly any[]> = T['length']

Solution by dienphamvan #35882

type Length<T extends any[] | readonly any[]> = T['length'];

Solution by Positivchik #35852

// 你的答案
type Length<T extends readonly any[]> = T['length']

Solution by naruto-823 #35787

type Length<T extends any[]> = T['length'];

Solution by Sensuele #35760

type Length<T extends readonly any[]> = T['length']

Solution by XenoPOMP #35740

// 你的答案
type Length<T extends readonly string[]> = T['length']

Solution by ndwgg #35543

// 你的答案
type Length<T extends readonly string[]> = T['length']

Solution by ndwgg #35542

type Length<T extends readonly any[]> = T['length']

Solution by thukyaw11 #35528

// 여기 풀이를 입력하세요
type Length<T> = T extends {length: number} ? T["length"] : never

Solution by Gwanghun-Im #35499

type Length<T extends ReadonlyArray<unknown>> = T['length']

Solution by gangnamssal #35469

type Length<T extends readonly PropertyKey[]> = T['length']

or

type Length<T extends readonly PropertyKey[]> = T extends {length: infer L} ? L : never

Solution by RanungPark #35432

// your answers
type Length<T extends readonly any[]> = T["length"];

Solution by Sathiyapramod #35418

// your answers
type Length<T extends readonly any[]> = T["length"];

Solution by Sathiyapramod #35412