HTML
Disclosure: This article may contain affiliate links. When you purchase, we may earn a commission.

Friday, December 31, 2021

Top 5 Spring Certification Books and Courses for Java Developers in 2023 - Best of Lot

If you are preparing for Spring Professional certification (VMware EDU-1202) and looking for the best books, online courses, and practice tests for your preparation then you have come to the right place. As an author of a Java blog and a medium publication, I often receive questions about how to self-prepare for a technical certification like Spring Professional v5.0 certification from Pivotal, and which are the best books and courses to prepare for Spring Core certification? After answering a couple of my readers over Facebook chats and linking in, I decided to jot down my recommendations. Books, Online Courses, Study Guides, and Practice tests are some of the important resources to prepare for Spring certifications.

Thursday, December 30, 2021

Top 5 JavaScript Data Structure and Algorithm Courses for Beginners to Learn in 2023 - Best of Lot

Hello guys, if you are a JavaScript developer learning Data Structure and Algorithms and looking for the best online course to learn Algorithms and Data Structure in JavaScript, then you have come to the right place. In the past, I have shared free classes to learn JavaScript and data structure Algorithmsand today, I will share the best courses to learn Data Structure and Algorithms. These courses have been created by expert instructors like Colt Steele, Andrei Neagoie, and Stephen Grider and are trusted by thousands of developers. They are also very affordable, especially the Udemy courses you can buy for just $10 on Udemy sales which happens every now and then.

Top 5 Design Patterns Books for Java Developers - Best of Lot

Design patterns are an essential topic for object-oriented programmers, like Java and C++ developers. It becomes even more important as your experience grows because everybody starts expecting a lot more from you in terms of writing quality code. I often receive emails from intermediate and senior Java developers about progressing to the next level, like how to become Tech Lead, Team Lead, or software architect; knowledge of design patterns plays an important role in taking more technical responsibility. While the GoF book is the bible for object-oriented design patterns, in my opinion, it is a bit too dry and academic.

Monday, December 27, 2021

Top 6 SQL and Database Courses for Programmers and Data Scientists in 2023 - Best of Lot

Hello guys, if you want to learn SQL and Database and look for the best Udemy courses, you have come to the right place. Earlier, I have shared the best free SQL courses, which contain free courses from Udemy and Coursera, and other websites. This article will share the best SQL courses from Udemy, suitable for beginners and intermediate developers. SQL has been a vital tech skill for a long time, but with the advent of Data Science and Data Analysis, the importance of data has made it even more critical in today's world. 

Sunday, December 26, 2021

Top 10 Cloud Certification (AWS, Azure, and GCP) You can Aim in 2023 - Best of Lot

Hello guys, if you are aiming for cloud certifications in 2023 but are not sure which cloud certification should you go for then you have come to the right place. Earlier, I have shared a list of the best IT certifications for Java developers, and today, I am going to talk about the best cloud certification to aim for in 2023. You can go through this list of cloud certifications and choose the best one depending upon your skills and experience. I have shared the best cloud certifications for beginners, developers, system admins, and solution architects from Amazon AWS, Microsoft Azure, and Google Cloud Platform. 

Friday, December 24, 2021

Top 10 Algorithms books Every Programmer Should Read

Algorithms are language agnostic, and any programmer worth their salt should be able to convert them to code in their programming language of choice. Unfortunately, I have come across several programmers who are REALLY good at programming languages like Java or Python, like know minor details of API and language intricacies but have very poor knowledge of the fundamentals of Algorithms and Data Structure. Just ask them to implement any popular sorting algorithms like quicksort or merge sort, and they will fall apart. If you expect them to know more advanced and sophisticated algorithms like String processing algorithms, graph algorithms, tree traversal, or greedy algorithms, be ready to check on Interviews; otherwise, you might end up with some surprises.

Tuesday, December 21, 2021

Top 100 Data Structure and Algorithm Interview Questions for Java Programmers

Data structure and algorithms are a core part of any Programming job interview. It doesn't matter whether you are a C++ developer, a Java developer, or a Web developer working in JavaScript, Angular, React, or Query. As a computer science graduate, it's expected from a program to have strong knowledge of both basic data structures, like the array, linked list, binary tree, hash table, Stack, Queue, and advanced data structures like the binary heap, trie, self-balanced tree, circular buffer, etc.

Monday, December 20, 2021

Top 10 Websites for Coding Interview Preparation in 2023- Best of Lot

If you are a fresher or final year graduate preparing for your placement interview, or a Java developer preparing for your next job and looking for some websites, blogs, and forums for programming interview questions then you have come to the right place. In the past, I have shared the essential skills for coding interviewsbest coding interview books, and best courses for coding interviews as well as many programming interview questions on topics like data structure, system design, multithreading, database and SQL, Linux, etc. In this article, I am going to share some of the really good websites and resources that will help you to prepare and do well in programming interviews. 

What are prototypes in JavaScript? Example Tutorial

Introduction

If you have used JavaScript, then you are definitely familiar with objects because objects are one of the commonly used data types not only in JavaScript but also in the entire programming community. An object in JavaScript looks like the following.


{

    name: “Tom”,

    age: 28,

    city: “New York

}

 


So basically, an object stores data in key-value pairs. We can create an object like we did above, and then assign it to a variable. This is one of creating objects in JavaScript. Another way is by using the constructor function. 


Every object created in JavaScript has a default property named prototype. The prototype property is often a consulting concept in JavaScript. In this article, we will discuss what the prototype property is in JavaScript and how to use it. 





Prototype

Observe the following code.


function Employee(name, age, city) {

  this.name = name;

  this.age = age;

  this.city = city;

}

 

 



“Employee” is a constructor function. Let’s see what is the value of the “Employee. prototype”.

What are prototypes in JavaScript? Example Tutorial




The prototype has several methods and properties. Observe the following image. 


What are prototypes in JavaScript



So, basically, the “Employee.prototype.constructor” is referring to “Employee” only. If we console “Employee.prototype”, then it will return only an empty object. This happens because as of now, we haven't added anything in the prototype of the “Employee” constructor. 






Adding properties

The prototype can be used to add new properties to a defined constructor function. 


Let’s create an object first. 


function Employee(name, age, city) {

  this.name = name;

  this.age = age;

  this.city = city;

}

 

const Emp1 = new Employee("Tom", 28, "New York");


The “Emp1” has three properties as of now - name, age, and city. 



Now, suppose, we want to add a new property named gender to the “Employee”. We can do this using the prototype.


Employee.prototype.gender = "male";


Now, let’s see if there is any change in “Employee”.



No, because we have added “gender” to the prototype. 



Now observe the “Emp1” object we created earlier.



The property added using the prototype is already available in the “Emp1” object.



Let’s create another object. 


function Employee(name, age, city) {

  this.name = name;

  this.age = age;

  this.city = city;

}

 

const Emp1 = new Employee("Tom", 28, "New York");

 

Employee.prototype.gender = "male";

 

const Emp2 = new Employee("Lisa", 21, "Chicago”);


The problem here is that the value of “gender” is “Emp2” is also “male”. So to change, we can simply assign a new value to it. 



This way of adding new properties to a constructor function using the prototype and then inheriting them in the objects is known as prototype inheritance.


One important point here to remember is that if we change the value of “gender”, then it will be changed for every new object but not for those which are declared before it.

function Employee(name, age, city) {

  this.name = name;

  this.age = age;

  this.city = city;

}

 

Employee.prototype.gender = "male";

 

const Emp1 = new Employee("Tom", 28, "New York");

const Emp2 = new Employee("Jack", 25, "Detroit");

 

Employee.prototype = {

  gender: "female",

};

 

const Emp3 = new Employee("Lisa", 21, "Chicago");


Let’s check the value of “gender” for every object. 



The value for “Emp3” is changed but not for “Emp1” and “Emp2” because they were declared before changing the value of “gender”.






Adding methods

Similarly, we can also use the prototype property to add new methods to a constructor function. 


Observe the following code. 


Employee.prototype.getDetails = function () {

  console.log(

    `Name of the employee: ${this.name}. \nAge: ${this.age} \nCity: ${this.city} \nGender: ${this.gender}`

  );

};


Using the prototype property, the “getDetails” method is added to the “Employee”. 


Let’s use the objects to invoke the “getDetails” method. 



It will work similarly for the other object created using “Employee”.


Now observe the following code.


Employee.prototype.getDetails = () => {

  console.log(

    `Name of the employee: ${this.name} \nAge: ${this.age} \nCity: ${this.city} \nGender: ${this.gender}`

  );

};


The “getDetails” method is an arrow function. So this means, this method does not “this” keyword, meaning, it will return undefined for name, age, city, and gender. 


Wrapping it up

So the object prototype is a simple and powerful yet confusing concept in JavaScript. As objects are an important part of modern JavaScript, it is recommended to understand the concept of prototypes. In this article, we discussed what is prototype and how it is used to add properties and methods to a constructor function.