Typescript: bracket notation property access

I added it as a separate interface because i need to keep original..

export interface IIndexable {
  [key: string]: any;
}

and referencing it when needed

getEditDate(r: IRestriction, fieldName: string) {
    ...
    value={(r as IIndexable)[fieldName] as Date}

works well. i will update if i find a way to shorten it

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)