Linked Questions
25 questions linked to/from flatMap, flat, flatten doesn't exist on type any[]
3 votes
1 answer
885 views
Deno: VS Code typescript doesnt know ES6 [duplicate]
I am building an app with deno and typescript. As my IDE I'm using VS Code. When I'm trying to use modern javascript syntax like await and flatMap VS Code underlines these statements in red and shows ...
1 vote
0 answers
160 views
Flatten array of arrays available in Javascript but not in TypeScript? [duplicate]
In Javascript, it is possible to flatten an array of arrays with Array.prototype.flat() (you can test it in Chrome's developer console) : const a = [1, 2, 3] const b = [4, 5, 6] const arr = [a, b]...
397 votes
22 answers
226k views
TypeScript filter out nulls from an array
TypeScript, --strictNullChecks mode. Suppose I have an array of nullable strings (string | null)[]. What would be a single-expression way to remove all nulls in a such a way that the result has type ...
198 votes
20 answers
264k views
How to find the invalid controls in Angular(v2 onwards) reactive form
I have a reactive form in Angular like below: this.AddCustomerForm = this.formBuilder.group({ Firstname: ['', Validators.required], Lastname: ['', Validators.required], Email: ['', ...
0 votes
4 answers
7k views
Join Map values into single string
I have the following code: let urls = new Map<string, any[]>(); urls.set("1", ["param=1", "param2=2", "params3=3"]); urls.set("2", ["param4=...
7 votes
1 answer
2k views
How to add lib es2019 to Angular project recently updated to v10, in vs code?
My objective is a working Angular v10 project, using .flat() on arrays. Our team recently upgraded our Angular project to version 10. The project now, based on the Angular CLI, has the following files ...
0 votes
2 answers
2k views
How to properly flatten an stream of observables?
Here's what I trying to do: Given a paginated API, get all the resources using parallel requests. The API returns a limited number of resources per call. So, you need to use an offset parameter to ...
1 vote
2 answers
4k views
error TS2339: Property 'flatMap' does not exist on type 'any
We just upgraded our application from Angular 4 to Angular 7. The site is up and running with ng serve locally and also working fine in multiple environments(ETE, QA, Pilot etc) with builds against ...
3 votes
1 answer
852 views
Angular split list
I have a list looking like so [[{A},{B}], {C}] Is there any simple method without having to create a function that will flatten this to an array looking like so [{A},{B},{C}] I searched on SO but ...
-1 votes
2 answers
921 views
Javascript filter array of objects by key of another array of objects
I have an array of products and an array of products that a user has access to. They share a common ID. I want to filter the array of products to only return those that the user has access to. All ...
0 votes
1 answer
1k views
TypeScript- Extract values from array in array
I have an array like that : [{ "id": 1, "city": [{ "name": "BERLIN", } ], }, { "id": 2,...
-2 votes
1 answer
1k views
Remove one level from object array
I'm trying to remove the indexes of an array in the easiest and most efficient possible way. This is the array like: Having this array (see snipet): let arr = []; arr.push([{id:1}]); arr.push([{id:...
0 votes
1 answer
1k views
Property 'flatMap' does not exist on type 'string[]'. NOT AN ES2019 PROBLEM
I have this example set up on StackBlitz. It won't compile because there is a line that uses flatMap. The error says: Property 'flatMap' does not exist on type 'string[]'. Do you need to change your ...
-4 votes
2 answers
2k views
Property 'title' does not exist on type?
by 23 lines I get this Property 'title' does not exist on type 'faceProductList | faceProductList[]'Why does such an error occur as to solve it? code interface faceProductList { readonly title: ...
2 votes
2 answers
694 views
How can i access values in an array of Objects using typescript with angular 9?
I am trying to retrieve values from a table in quickbase. this is what i have so far.... service.ts public getNativeFields(){ let headers = new HttpHeaders().set("QB-Realm-Hostname&...