return getArrayFromTree(step_to, now_arr[first]);
<div>
<app-component style="display: flex"><!-- Внутри флекс элементы --></app-component>
</div>
function doSmth(obj) {
console.log(obj.id)
}
function isRightObj(obj) {
return obj.id === 6
}
function reqursive(obj) {
if ( isRightObj(obj) ) {
doSmth(obj)
}
const childs = obj.childGroups
if (childs && Array.isArray(childs)) {
childs.forEach(reqursive)
}
}
reqursive(obj)
React does not guarantee that the state changes are applied immediately.
setState() does not always immediately update the component. It may batch or defer the update until later.
function compare(str1, str2) {
return clearString(str1) === clearString(str2);
}
function clearString(str) {
return str.toLowerCase().replace(/\s/g, '');
}
compare(name, name2) // => true
ngOnInit(){
this.verifyService.verifyToken(this.token)
.subscribe(data => respondHandler(data))
}
ngOnInit(){
this.verifyService.verifyToken(this.token)
.subscribe(data => this.respondHandler(data), error => this.errorHandler(error))
}