0
How could I extract from a string like this:
var texto = '4°, 5° e 6° ano';
A result like this:
var array = [
4,
5,
6
];
Or even better this way:
var array = [
'4° ano',
'5° ano',
'6° ano'
];
I tried to do it, but it didn’t work out so well:
$scope.filterRecomendations = function(recomend) {
var list = recomend.split(' e ');
var collection = [];
for(var i in list) {
list[i].split(', ')
collection.push(list[i]);
}
collection.flat(Infinity);
return collection;
};
Printed a weird thing like that on ng-repeat:
[["4º"]["5º"]["6º ano"]]
Example when there is only one class: