0

Sorry as this seems like something simple but I can't find how to do it.

Let's say I have an array A of some unknown size, and an array B of the same size of say numbers. And I zip them together to create an object W with keys from A paired with numbers from B.

Of course generally I just mean I have an object of some unknown size created from some generated keys and generated values which I know the type of.

How do I declare the type of W (say for the purpose of defining a function)? I would like to say something like object< type > but this doesn't seem to be it.

0

1 Answer 1

2
{[key:string]:any}

where string is the type of the keys and any is the type of the values

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.