Example of React.create Class
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js"></script>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<div id="mainContainer" class="w3-container"></div>
JavaScript
(function(){
'use strict'
// custom javaScript content
var employeeList = [];
employeeList.push({ "name" : "Petre q", "profession" : "Musician", "salary/hr" : "60 USD" });
employeeList.push({ "name" : "John Novano", "profession" : "Lawyer", "salary/hr" : "100 USD" });
employeeList.push({ "name" : "John Novano", "profession" : "Lawyer", "salary/hr" : "100 USD" });
employeeList.push({ "name" : "Caleb Keats", "profession" : "Electrician", "salary/hr" : "40 USD" });
employeeList.push({ "name" : "Chris Prat", "profession" : "Security Gaurd", "salary/hr" : "20 USD" });
employeeList.push({ "name" : "Joshua Hiens", "profession" : "Butler", "salary/hr" : "27 USD" });
employeeList.push({ "name" : "Tim Robbins", "profession" : "Physical Trainer", "salary/hr" : "50 USD" });
employeeList.push({ "name" : "George Aptik", "profession" : "Laboritory Technician", "salary/hr" : "50 USD" });
// creating table row list
// on the basis of employee list
var trElementList = (function(list){
var trList = [],
trElement = undefined,
trElementCreator = trElementCreator,
employeeElement = undefined;
// creating the row with table-header element
var tableHeaderCreator = (function(obj){
var thList = [],
thElement = null;
for(var prop in obj){
thElement = React.createElement('th',null,prop.toUpperCase());
thList.push(thElement);
} // end of for
return React.createElement('tr',null,thList);
})(list[0]);
trList.push(tableHeaderCreator); // add row containing table-header element to row list
// iterating through employee list and
// creating row for each employee
for(var x = 0; x < list.length; x++){
employeeElement = list[x];
trElement = (function(employee){
var trComp = trElementCreator(employee); // create row per employee
return...