JSFiddle - React, Tailwind, and code Playground
by velmurugansp
HTML
<form>
</form>
JavaScript
class Student{
rollNo
studentName
department
academicYear
mailId
phoneNo
address
bloodGroup
constructor(studentObject){
this.studentName = studentObject.name;
this.rollNo = studentObject.roll;
this.department = studentObject.department;
this.academicYear = studentObject.academicYear;
this.mailId = studentObject.mailId;
this.phoneNo = studentObject.phoneNo;
this.address = studentObject.address;
this.bloodGroup = studentObject.bloodGroup;
}
getName(){
return this.studentName;
}
}
let sampleData = {
"roll": 648946,
"name": "Ravi Kumar",
"department": "EEE",
"academicYear": 2023,
"mailId": "[email protected]",
"phoneNo": 9874562014,
"address": "Kurukku Santhu, Dubai",
"bloodGroup": "O+"
}
let students = [];
students.push( new Student(sampleData) );
students.push( new Student(sampleData) );
console.log(students);