Skip to main content

ts实现valueOf

· One min read

需求场景

ts自带的操作符有keyof,typeof,可是没有valueOf

解决方案

type ValueOf<T> = T[keyof T];