JSFiddle - React, Tailwind, and code Playground

by Zaheer Ahmed

JavaScript

var Student = function () {
    this.first_name;
    this.last_name;
    this.courses = [];

    this.fullName = function () {
        return this.first_name + ' ' + this.last_name;
    };
};

var student = new Student();

student.first_name = "Ali";
student.last_name = "Raza";
student.courses = ["JavaScript", "Object Orient Programming", "Functional Programming"];
var full_name = student.fullName()
console.log(full_name);
console.log('No. of Courses : ' + student.courses.length);