Posts

Extract list of values from an array of objects to an array based on a key in JavaScript.

Image
There may be a situation where you want to extract the list of values of a specific key from an objects to an array.  Method 1: In one way, we can use both for loop and Array.push() method and achieve it.  For example, we have an Array of objects as below let studentsObject = [     {         "name" : "John" ,         "age" : 26     },     {         "name" : "Helen" ,         "age" : 42     },     {         "name" : "Cole" ,         "age" : 54     },     {         "name" : "Noah" ,         "age" : 38     } ] we can extract the values as shown below  let namesList ; studentsObject . forEach ( student => {     namesList . push ( student . name ) }); console . log ( namesList ); //Output [ 'John' , 'Helen' , 'Cole'...

Angular Interview Questions

Image
If you are here reading this post, you might be preparing for interviews. I promise that I'll jot down the most frequently asked interview questions  and answers based on my interview experience as of 2021.  H ope this article will help you in cracking your dream job. 1.What is Angular? Angular is an open-source web application framework that uses TypeScript programming language. Developed by Google. Framework: Predefined structure of something. 2. What is AngularJS? Angular is an open-source web application framework that uses JavaScript programming language.  Developed by Google. It is an older version of Angular. 3. What are the differences between AngularJS and Angular? AngularJS : AngularJS is actually the first version of Angular (Angular1). AngularJS framework uses JavaScript language. It is not supported on mobile devices. It is slower than Angular. It doesn’t support dependency injection. It follows MVC architecture. Managing huge applications is difficult. Angul...