Founder Of Geekstrick. Full-Time Software Developer, Expertise in Frontend Development. Conversant with - Angular, React, NodeJS, and MongoDB, MySQL, Postgres,HTML+CSS+JS, CypressIO.

Answer for Reusable component in Angular 10 for displaying a list of items

geekstrick on March 1, 2023 πŸ”₯ 0 views

@Component({ selector: β€˜app-list’, template: ` <ul> <li *ngFor=”let item of items”> {{item}} </li> </ul> `, styles: [] }) export class ListComponent { @Input() items: any[]; }


What is the difference between observable forkJoin and combineLatest?

geekstrick on December 18, 2022 πŸ”₯ 0 views

Does the Observable.forkJoin work the same as the Observable.combineLatest let observable1 = service.observable1(); let observable2 = service.observable2(); let observable3 = service.observable3(); let joinedObservables = forkJoin(observable1, observable2, observable3).subscribe(x => { let result1 = x[0]; let result2 = x[1]; let result3 = x[2]; }); let joinedObservables = combineLatest(observable1, observable2, observable3).subscribe(x => { let result1 = x[0]; let […]


MongoDB 6.0 – New Version Released

geekstrick on July 20, 2022 πŸ”₯ 2702 views

MongoDB 6.0 – New Version Released and download is available. This major release has improvements to existing features, also new products have been introduced to empower you to build faster, troubleshoot less, and removes complexity from your workflows. MongoDB 6.0 MongoDB 6.0 includes more integrations, several feature upgrades, support for a diverse range of scenarios, […]


Answer for Compiling to Older Versions of Java Using by Maven

geekstrick on July 11, 2022 πŸ”₯ 0 views

Better use a JDK17 and use –release options is much better… Simplest solution is as already suggest use JDK17 and use <maven.compiler.release>8</maven.compiler.release> that makes sure you use only code which is available in JDK8…


Answer for Sieve of Eratosthenes in Java

geekstrick on July 9, 2022 πŸ”₯ 0 views

The basic idea: a prime number is divisible only by itself and 1, and 1 itself isn’t a prime number. So the first prime number is 2. To identify prime numbers, start with 2, add that to a list of prime numbers, strike out all multiples of 2 (because they are all divisible by 2 […]


How to place an element in an array from one place to another?

geekstrick on January 8, 2022 πŸ”₯ 873 views

Consider the array [‘one’, ‘two’, ‘four’, ‘three’] and we want to arrange the last two element. /** * move element one place to other in existing array * @param {any[]} arr: array Value * @param {number} from: index of value that need to be moved * @param {number} to: index where need to be placed […]


Create Library In Angular 12 – Search Highlighter

geekstrick on September 20, 2021 πŸ”₯ 9064 views

In this tutorial, we will see how to Create a Library In Angular 12. Search Highlighter is what we are going to create throughout this article. If you are not aware of what is an angular library – Basically library is created to use some piece of code or you can say functionality to various […]


How to get properties indicated by given selectors from an object?

geekstrick on September 7, 2021 πŸ”₯ 601 views

Consider an object from which we want to retrive properties. const obj = { earth: { level: { one: ‘soft mud and rocks’ } }, vibrations: [1, 2, { range: ‘medium’ }], }; Use […].map() for each selector, “vibrations[2].range”.replace() to replace square brackets with dots. Use “”.split(‘.’) to split each selector. Use […].filter() to remove […]


How to parse cookies in javascript?

geekstrick on September 6, 2021 πŸ”₯ 23845 views

In the browser cookies is store in string format containing key-value pairs. So, how to parse a browser Cookie string and return an object of all cookie name-value pairs? separate each key-value pair using String.prototype.split(‘;’) Use and String.prototype.split(‘=’) to separate keys from values in each pair. Use Array.prototype.reduce() and decodeURIComponent() to create an object […]


How to use for loops to break out early in javascript?

geekstrick on September 3, 2021 πŸ”₯ 878 views

for loop in modern JavaScript is rarely talked about although it’s only useful in asynchronous operation scenarios. But what breaking out early consider the following example: Matching two array const smallArray = [0, 2]; const largeArray = Array.from({ length: 1000 }, (_, i) => i); const areEqual = (a, b) => { let result = […]

1 2 3 21