What is chatGPT?


ChatGPT is a large language model developed by OpenAI. It is trained on a dataset of conversational text, and is able to generate human-like responses to text-based prompts. It can be used for a variety of natural language processing tasks, such as language translation, text summarization, and question answering.



Features of ChatGPT:

ChatGPT has several key features that make it a powerful language model for natural language processing tasks:

Pre-training: ChatGPT is pre-trained on a large dataset of conversational text, which allows it to understand the context and structure of conversational language.

Fine-tuning: Because it is pre-trained, ChatGPT can be fine-tuned for specific tasks using a smaller dataset. This allows for better performance on those tasks than training a model from scratch.

Generative model: ChatGPT is a generative model, meaning it can generate new text based on a given prompt or context. This allows it to be used for tasks such as language translation, text summarization and question answering.

Contextual understanding: ChatGPT is able to understand the context of a conversation, which allows it to generate more relevant and natural-sounding responses.

High quality outputs: Due to its large size and pre-training, ChatGPT can generate high-quality, human-like text, making it well suited for tasks such as chatbots and virtual assistants.



 Constructor in Javascript

In this article we are goanna to see about Constructor in Javascript and where we use these. which is most important when you are going to start your career in JavaScript. Please ready and enjoy this article if you want to give any feedback about your experience, we welcome.


Constructor is special function that prepare new instance of an object for use.

Example:

function Mobile( ){

this.model = “mi 9 pro”,

this.price = function( ){ document.write(this.model + “Price 3000”);

}

}

var redmi = new Mobile();

document.write(redmi.model + redmi.price( ));

Constructor with parameter:

Example:

function Mobile(model_name ){

this.model = model_name,

this.price = function( ){ document.write(this.model + “Price 3000”);

}

}

var redmi = new Mobile(“mi 9”);

document.write(redmi.model + redmi.price( ));


 Factory Function in Javascript

In this article we are goanna to see about Factory Function in Javascript and where we use these. which is most important when you are going to start your career in JavaScript. Please ready and enjoy this article if you want to give any feedback about your experience, we welcome.



A factory function is any function which is not a class or constructor that returns an object. In JavaScript, any function can return an object. When it does so without the new keyword, it’s a factory function.

Example:

function mobile( ){

return { 

model: “mi 9 pro”,

price: function( ){ return (“Price 3000”);}

};

}

var redmi = mobile( );

document.write(redmi.model + redmi.price( ));


Example:

function mobile(model_name ){

return { 

model : model_name;

price : function( ){ return (“Price 3000”);}

};

}

var redmi = mobile(“redmi pro 9” );

var nokia = mobile(“nokia 3000” );

document.write(redmi.model + redmi.price( ));


 Object Literal Properties and Method in Javascript

In this article we are goanna to see about Object Literal Properties and Method in Javascript and where we use these. which is most important when you are going to start your career in JavaScript. Please ready and enjoy this article if you want to give any feedback about your experience, we welcome.



Properties

A property of an object is some piece of named data it contains. These are accessed with dot operator applied to an object alternative to the dot operator is the array[ ] operator.

Syntax:  object_name.property_name

Ex:

var person = { fname: 'Raj’, lname: 'Kumar’, age: 25 };

var person = { };

person[“fname”] = “Raj”;   or person.fname =  “Raj”;

document.write(person.fname);

document.write(person[‘fname’]);

delete person.fname

Method

Object members that are functions are called methods. These are accessed with dot operator applied to an object alternative to the dot operator is the array[ ] operator.

Syntax:  object_name.method_name( );

Ex:

var person = { fname: 'Raj’, lname: 'Kumar’, fullname: function(){return (“Hello world”}}

var person = { };

person[“fullname”] = function(){return (“Hello world”)};  

person.fullname = function(){return (“Hello world”)}; 

document.write(person.fullname());

document.write(person[‘fullname’]());

       delete person.fname()


 Objects in Javascript

In this article we are goanna to see about Objects in Javascript and where we use these. which is most important when you are going to start your career in JavaScript. Please ready and enjoy this article if you want to give any feedback about your experience, we welcome.


An object is a collection of properties, and a property is an association between a name (or key) and a value. A property's value can be a function, in which case the property is known as a method. In addition to objects that are predefined in the browser, you can define your own objects. 

Syntax:

objectName.propertyName

Ex:

var person = { fname: 'Raj’, lname: 'Kumar’, age: 25 };

document.write(person.fname);

document.write(person.lname);

Almost "everything" is an object javascript.

Booleans can be objects (if defined with the new keyword)

Numbers can be objects (if defined with the new keyword)

Strings can be objects (if defined with the new keyword)

Dates are always objects

Maths are always objects

Regular expressions are always objects

Arrays are always objects

Functions are always objects

Objects are always objects

All JavaScript values, except primitives, are objects

Declaration and initialization of Object:

Syntax:

var object_name = { };

Ex:

var person = { };

person[‘fname’] = “Rajesh”;

person[‘lname’] = “Kumar”;

person[‘age’] = 26

document.write(person.fname);



 OOPS Concept in Javascript

In this article we are goanna to see about OOPS concept in Javascript and where we use these. which is most important when you are going to start your career in JavaScript. Please ready and enjoy this article if you want to give any feedback about your experience, we welcome.



Object Oriented Programming Concept

Abstraction: 

Abstraction is a way of creating a simple model of a more complex real-world entities, which contains the only important properties from the perspective of the context of an application.

An abstraction is a way of hiding the implementation details and showing only the functionality to the users. In other words, it ignores the irrelevant details and shows only the required one.

Important point:

We cannot create an instance of Abstract Class.

It reduces the duplication of code.

2. Encapsulation: 

The Encapsulation is a process of binding the data (i.e. variables) 

with the functions acting on that data. It allows us to control the data and validate it. 

To achieve an encapsulation in JavaScript: -

Use var keyword to make data members private. Use setter methods to set the data and getter methods to get that data.

3. Inheritance: 

The inheritance is a mechanism that allows us to create new classes on the basis of already existing classes. It provides flexibility to the child class to reuse the methods and variables of a parent class.

The JavaScript extends keyword is used to create a child class on the basis of a parent class. It facilitates child class to acquire all the properties and behavior of its parent class.

4. Polymorphism: 

The polymorphism is a core concept of an object-oriented paradigm that provides a way to perform a single action in different forms. It provides an ability to call the same method on different JavaScript objects.

As JavaScript is not a type-safe language, we can pass any type of data members with the methods.