python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
How to change the interface key: value: string to [{ [key: string]: string }
I have interface
IUser {
name: string;
surname: string;
cityLocation: string;
}
the value will be
const user: IUser = {
"name": "John";
"surname": "Smith&...
Jackson
Votes: 0
Answers: 1
Get string literal types from Array of objects
So from:
export interface Category{
val: string;
icon: string
}
const categoryArray: Category[] = [
{
val: 'business',
icon: 'store'
},
{
val: 'media',
icon: 'video'
},
{...
TrySpace
Votes: 0
Answers: 1