const esSource = { "FIPS": "06037", "APN": "7543-025-003", "APNSeqNbr": "1", "OldAPN": null, "OldApnIndicator": null, "TaxAccountNumber": null, "SitusFullStreetAddress": "2415 VIA RIVERA", "SitusHouseNbr": "2415", "SitusHouseNbrSuffix": null, "SitusDirectionLeft": null, "SitusStreet": "VIA RIVERA", "SitusMode": null, "SitusDirectionRight": null, "SitusUnitType": null, "SitusUnitNbr": null, "SitusCity": "PALOS VERDES ESTATES", "SitusState": "CA", "SitusZIP5": "90274", "SitusZIP4": "2727", "SitusCarrierCode": "C014", "SitusLatitude": 33.773704, "SitusLongitude": -118.414536, "SitusGeoStatusCode": "B", "PropertyClassID": "R", "LandUseCode": "1001", "StateLandUseCode": null, "CountyLandUseCode": "0100", "Zoning": "PVR1*", "SitusCensusTract": "670328", "SitusCensusBlock": "3016", "MobileHomeInd": null, "TimeshareCode": null, "SchoolDistrictName": "Palos Verdes Peninsula Unified School District", "LotSizeFrontageFeet": "0000000630", "LotSizeDepthFeet": "1350", "LotSizeAcres": "0000000237", "LotSizeSqFt": 10316, "Owner1CorpInd": "T", "Owner1LastName": null, "Owner1FirstName": null, "Owner1MiddleName": null, "Owner1Suffix": null, "Owner2CorpInd": "T", "Owner2LastName": null, "Owner2FirstName": null, "Owner2MiddleName": null, "Owner2Suffix": null, "Owner3CorpInd": null, "Owner3LastName": null, "Owner3FirstName": null, "Owner3MiddleName": null, "Owner3Suffix": null, "Owner4CorpInd": null, "Owner4LastName": null, "Owner4FirstName": null, "Owner4MiddleName": null, "Owner4Suffix": null, "OwnerNAME1FULL": "STRONG TRUST", "OwnerNAME2FULL": "STRONG CHRISTOPHER CO TR", "OwnerNAME3FULL": null, "OwnerNAME4FULL": null, "OwnerOccupied": "Y", "Owner1OwnershipRights": "RT", "MailingFullStreetAddress": "2415 VIA RIVERA", "MailingHouseNbr": "2415", "MailingHouseNbrSuffix": null, "MailingDirectionLeft": null, "MailingStreet": "VIA RIVERA", "MailingMode": null, "MailingDirectionRight": null, "MailingUnitType": null, "MailingUnitNbr": null, "MailingCity": "PALOS VERDES ESTATES", "MailingState": "CA", "MailingZIP5": "90274", "MailingZIP4": "2727", "MailingCarrierCode": "C014", "MailingOptOut": null, "MailingCOName": null, "MailingForeignAddressInd": null, "AssdTotalValue": 826189, "AssdLandValue": 638699, "AssdImprovementValue": 187490, "MarketTotalValue": 0, "MarketValueLand": 0, "MarketValueImprovement": 0, "TaxAmt": 1036724, "TaxYear": "2022", "TaxDeliquentYear": null, "MarketYear": null, "AssdYear": "2022", "TaxRateCodeArea": "07-112", "SchoolTaxDistrict1Code": null, "SchoolTaxDistrict2Code": null, "SchoolTaxDistrict3Code": null, "HomesteadInd": "T", "VeteranInd": null, "DisabledInd": null, "WidowInd": null, "SeniorInd": null, "SchoolCollegeInd": null, "ReligiousInd": null, "WelfareInd": null, "PublicUtilityInd": null, "CemeteryInd": null, "HospitalInd": null, "LibraryInd": null, "BuildingArea": 2259.0, "BuildingAreaInd": "L", "SumBuildingSqFt": 2259.0, "SumLivingAreaSqFt": 2259, "SumGroundFloorSqFt": null, "SumGrossAreaSqFt": null, "SumAdjAreaSqFt": null, "AtticSqFt": null, "AtticUnfinishedSqFt": null, "AtticFinishedSqFt": null, "SumBasementSqFt": null, "BasementUnfinishedSqFt": null, "BasementFinishedSqFt": null, "SumGarageSqFt": null, "GarageUnFinishedSqFt": null, "GarageFinishedSqFt": null, "YearBuilt": "1954", "EffectiveYearBuilt": "1958", "Bedrooms": 3.0, "TotalRooms": 6.0, "BathTotalCalc": 3.0, "BathFull": 3.0, "BathsPartialNbr": 0.0, "BathFixturesNbr": null, "Amenities": null, "AirConditioningCode": 1, "BasementCode": null, "BuildingClassCode": null, "BuildingConditionCode": 3, "ConstructionTypeCode": 17, "DeckInd": null, "ExteriorWallsCode": 12, "InteriorWallsCode": null, "FireplaceCode": 1, "FloorCoverCode": null, "Garage": null, "HeatCode": 3, "HeatingFuelTypeCode": null, "SiteInfluenceCode": null, "GarageParkingNbr": 2, "DrivewayCode": null, "OtherRooms": null, "PatioCode": null, "PoolCode": null, "PorchCode": null, "BuildingQualityCode": 1, "RoofCoverCode": 13, "RoofTypeCode": 1, "SewerCode": null, "StoriesNbrCode": "100", "StyleCode": 15, "SumResidentialUnits": 1.0, "SumBuildingsNbr": 1.0, "SumCommercialUnits": null, "TopographyCode": null, "WaterCode": null, "LotCode": null, "LotNbr": "3", "LandLot": null, "Block": "2", "Section": null, "District": null, "LegalUnit": null, "Municipality": "SOUTH /P V ESTATES SFR", "SubdivisionName": null, "SubdivisionPhaseNbr": null, "SubdivisionTractNbr": "16945", "Meridian": null, "AssessorsMapRef": null, "LegalDescription": "TRACT # 16945 LOT/SEC 3 BLK/DIV/TWN 2", "CurrentSaleTransactionId": 1036750736, "CurrentSaleDocNbr": "1996.418005", "CurrentSaleBook": null, "CurrentSalePage": null, "CurrentSaleRecordingDate": "19960315", "CurrentSaleContractDate": "19960112", "CurrentSaleDocumentType": "36", "CurrentSalesPrice": 510000, "CurrentSalesPriceCode": "13", "CurrentSaleBuyer1FullName": "STRONG CHRISTOPHER A", "CurrentSaleBuyer2FullName": "STRONG NOREEN E", "CurrentSaleSeller1FullName": "TURNER TOM H", "CurrentSaleSeller2FullName": "TURNER ANN M", "ConcurrentMtg1DocNbr": null, "ConcurrentMtg1Book": null, "ConcurrentMtg1Page": null, "ConcurrentMtg1RecordingDate": "19960315", "ConcurrentMtg1LoanAmt": 408000, "ConcurrentMtg1Lender": "CITY NATL BANK", "ConcurrentMtg1Term": "360", "ConcurrentMtg1InterestRate": "701", "ConcurrentMtg1LoanDueDate": "20260401", "ConcurrentMtg1AdjOrFix": null, "ConcurrentMtg1LoanType": "22", "ConcurrentMtg1TypeFinancing": null, "ConcurrentMtg2DocNbr": null, "ConcurrentMtg2Book": null, "ConcurrentMtg2Page": null, "ConcurrentMtg2RecordingDate": null, "ConcurrentMtg2LoanAmt": 12000, "ConcurrentMtg2Lender": null, "ConcurrentMtg2Term": null, "ConcurrentMtg2InterestRate": null, "ConcurrentMtg2LoanDueDate": null, "ConcurrentMtg2AdjOrFix": null, "ConcurrentMtg2LoanType": null, "ConcurrentMtg2TypeFinancing": null, "PrevSaleTransactionId": null, "PrevSaleDocNbr": null, "PrevSaleBook": null, "PrevSalePage": null, "PrevSaleRecordingDate": null, "PrevSaleContractDate": null, "PrevSaleDocumentType": null, "PrevSalesPrice": null, "PrevSalesPriceCode": null, "PrevSaleBuyer1FullName": null, "PrevSaleBuyer2FullName": null, "PrevSaleSeller1FullName": null, "PrevSaleSeller2FullName": null, "PrevMtg1DocNbr": null, "PrevMtg1Book": null, "PrevMtg1Page": null, "PrevMtg1RecordingDate": null, "PrevMtg1LoanAmt": null, "PrevMtg1Lender": null, "PrevMtg1Term": null, "PrevMtg1InterestRate": null, "PrevMtg1LoanDueDate": null, "PrevMtg1AdjRider": null, "PrevMtg1LoanType": null, "PrevMtg1TypeFinancing": null, "TotalOpenLienNbr": 1, "TotalOpenLienAmt": 890000, "Mtg1TransactionId": 2691841495, "Mtg1RecordingDate": "20170118", "Mtg1LoanAmt": 890000, "Mtg1Lender": "CITY NATIONAL BANK", "Mtg1PrivateLender": null, "Mtg1Term": 360.0, "Mtg1LoanDueDate": null, "Mtg1AdjRider": null, "Mtg1LoanType": "27", "Mtg1TypeFinancing": null, "Mtg1LienPosition": 1, "Mtg2TransactionId": null, "Mtg2RecordingDate": null, "Mtg2LoanAmt": null, "Mtg2Lender": null, "Mtg2PrivateLender": null, "Mtg2Term": null, "Mtg2LoanDueDate": null, "Mtg2AdjRider": null, "Mtg2LoanType": null, "Mtg2TypeFinancing": null, "Mtg2LienPosition": null, "Mtg3TransactionId": null, "Mtg3RecordingDate": null, "Mtg3LoanAmt": null, "Mtg3Lender": null, "Mtg3PrivateLender": null, "Mtg3Term": null, "Mtg3LoanDueDate": null, "Mtg3AdjRider": null, "Mtg3LoanType": null, "Mtg3TypeFinancing": null, "Mtg3LienPosition": null, "Mtg4TransactionId": null, "Mtg4RecordingDate": null, "Mtg4LoanAmt": null, "Mtg4Lender": null, "Mtg4PrivateLender": null, "Mtg4Term": null, "Mtg4LoanDueDate": null, "Mtg4AdjRider": null, "Mtg4LoanType": null, "Mtg4TypeFinancing": null, "Mtg4LienPosition": null, "IsListedFlag": null, "IsListedFlagDate": null, "IsListedPriceRange": null, "VacantFlag": null, "VacantFlagDate": null, "flCommunityName": "City of Palos Verdes Estates", "flCommunityNbr": "060145", "flFemaMapNbr": "06037C1918H", "flFIRMID": "06037C", "flPanelNbr": "1918H", "flInsideSFHA": "F", "flFemaFloodZone": "X", "flFemaMapDate": "20210421", "HOA1Name": "PALOS VERDES", "HOA1Type": "HOA", "HOA1FeeValue": 550, "HOA1FeeFrequency": null, "HOA2Name": null, "HOA2Type": null, "HOA2FeeValue": null, "HOA2FeeFrequency": null, "FATimeStamp": "20221207", "FARecordType": "C", "Mtg1EstPaymentAmount": "4315.97", "Mtg2EstPaymentAmount": null, "Mtg3EstPaymentAmount": null, "Mtg4EstPaymentAmount": null, "Mtg1EstLoanBalance": 791023, "Mtg2EstLoanBalance": null, "Mtg3EstLoanBalance": null, "Mtg4EstLoanBalance": null, "Mtg1EstInterestRate": "413", "Mtg2EstInterestRate": null, "Mtg3EstInterestRate": null, "Mtg4EstInterestRate": null, "FAEstLotSqFt": 10314, "DTDB_REFID": "9153078", "LastUpdatedAt": "2023-05-26T14:07:03.8962091Z" } var esDictionary = {} for (const [key, value] of Object.entries(esSource)) { if (value !== null) { //pm.environment.set(key, value) esDictionary[key.toUpperCase()] = value } } //console.log(esDictionary) const apiResponse = { "propertyIdentification": { "fips": { "code": "06037", "description": "LOS ANGELES" }, "propertyID": 13850523, "apn": "7543-025-003", "apnSeqNbr": "1", "dtdB_REFID": "9153078", "deliveryPointBarcode": "902742727154" }, "propertyAddress": { "situsFullStreetAddress": "2415 VIA RIVERA", "situsHouseNbr": "2415", "situsStreet": "VIA RIVERA", "situsCity": "PALOS VERDES ESTATES", "situsState": "CA", "situsZIP5": "90274", "situsZIP4": "2727", "situsCarrierCode": "C014", "situsLatitude": 33.773704, "situsLongitude": -118.414536, "situsGeoStatusCode": { "code": "B", "description": "Record was coded to the rooftop level" } }, "property": { "propertyClassID": { "code": "R", "description": "RESIDENTIAL" }, "landUseCode": { "code": "1001", "description": "Single Family Residential" }, "countyLandUseCode": "0100", "zoning": "PVR1*", "situsCensusTract": "670328", "situsCensusBlock": "3016", "schoolDistrictName": "Palos Verdes Peninsula Unified School District" }, "lotLand": { "lotSizeFrontageFeet": { "stringValue": "0000000630", "value": 63.0, "impliedDecimals": 1 }, "lotSizeDepthFeet": { "stringValue": "1350", "value": 135.0, "impliedDecimals": 1 }, "lotSizeAcres": { "stringValue": "0000000237", "value": 0.237, "impliedDecimals": 3 }, "lotSizeSqFt": 10316 }, "ownership": { "ownerOccupied": { "code": "Y", "description": "Owner-occupied property" }, "owners": [ { "ownerCorpInd": "T", "ownerNameFull": "STRONG TRUST", "ownerOwnershipRights": { "code": "RT", "description": "Revocable Trust" } }, { "ownerCorpInd": "T", "ownerNameFull": "STRONG CHRISTOPHER CO TR" } ] }, "mailAddress": { "mailingFullStreetAddress": "2415 VIA RIVERA", "mailingHouseNbr": "2415", "mailingStreet": "VIA RIVERA", "mailingCity": "PALOS VERDES ESTATES", "mailingState": "CA", "mailingZIP5": "90274", "mailingZIP4": "2727", "mailingCarrierCode": "C014" }, "values": { "assdTotalValue": 826189, "assdLandValue": 638699, "assdImprovementValue": 187490, "marketTotalValue": 0, "marketValueLand": 0, "marketValueImprovement": 0, "taxAmt": { "stringValue": "1036724", "value": 10367.24, "impliedDecimals": 2 }, "taxYear": "2022", "assdYear": "2022", "taxRateCodeArea": "07-112" }, "taxExemption": { "homesteadInd": "T" }, "buildingSquareFootage": { "buildingArea": 2259.0, "buildingAreaInd": { "code": "L", "description": "Living Area" }, "sumBuildingSqFt": 2259.0, "sumLivingAreaSqFt": 2259 }, "building": { "yearBuilt": "1954", "effectiveYearBuilt": "1958", "bedrooms": 3.0, "totalRooms": 6.0, "bathTotalCalc": 3.0, "bathFull": 3.0, "bathsPartialNbr": 0.0, "airConditioningCode": { "code": "1", "description": "Central" }, "buildingConditionCode": { "code": "3", "description": "Good" }, "constructionTypeCode": { "code": "17", "description": "Wood" }, "exteriorWallsCode": { "code": "12", "description": "Stucco" }, "fireplaceCode": 1, "heatCode": { "code": "3", "description": "Central" }, "garageParkingNbr": 2, "buildingQualityCode": { "code": "1", "description": "A" }, "roofCoverCode": { "code": "13", "description": "Wood Shake/Shingles" }, "roofTypeCode": { "code": "1", "description": "GABLE" }, "storiesNbrCode": { "code": "100", "description": "1 Story" }, "styleCode": { "code": "15", "description": "Conventional" }, "sumResidentialUnits": 1.0, "sumBuildingsNbr": 1.0 }, "legalDescription": { "lotNbr": "3", "block": "2", "municipality": "SOUTH /P V ESTATES SFR", "subdivisionTractNbr": "16945", "legalDescription": "TRACT # 16945 LOT/SEC 3 BLK/DIV/TWN 2" }, "lastSale": { "saleTransactionId": 1036750736, "saleDocNbr": "1996.418005", "saleRecordingDate": "19960315", "saleContractDate": "19960112", "saleDocumentType": { "code": "36", "description": "Grant Deed" }, "salesPrice": 510000, "salesPriceCode": { "code": "13", "description": "Full amount computed from Transfer Tax or Excise Tax. " }, "saleBuyerFullNames": [ "STRONG CHRISTOPHER A", "STRONG NOREEN E" ], "saleSellerFullNames": [ "TURNER TOM H", "TURNER ANN M" ] }, "lastSaleMortgages": [ { "mtgRecordingDate": "19960315", "mtgLoanAmt": 408000, "mtgLender": "CITY NATL BANK", "mtgTerm": "360", "mtgInterestRate": { "stringValue": "701", "value": 7.01, "impliedDecimals": 2 }, "mtgLoanDueDate": "20260401", "mtgLoanType": { "code": "22", "description": "Purchase Money Mortgage" } }, { "mtgLoanAmt": 12000 } ], "openLien": { "totalOpenLienNbr": 1, "totalOpenLienAmt": 890000, "liens": [ { "mtgTransactionId": 2691841495, "mtgRecordingDate": "20170118", "mtgLoanAmt": 890000, "mtgLender": "CITY NATIONAL BANK", "mtgTerm": 360.0, "mtgLoanType": { "code": "27", "description": "Unknown (DEFAULT)" }, "mtgLienPosition": 1 } ] }, "flood": { "flCommunityName": "City of Palos Verdes Estates", "flCommunityNbr": "060145", "flFemaMapNbr": "06037C1918H", "flFIRMID": "06037C", "flPanelNbr": "1918H", "flInsideSFHA": "F", "flFemaFloodZone": "X", "flFemaMapDate": "20210421" }, "homeOwnerAssociations": [ { "hoaName": "PALOS VERDES", "hoaType": { "code": "HOA", "description": "Home Owner Association" }, "hoaFeeValue": 550 } ], "additionalFAProcessing": { "faTimeStamp": "20221207", "faRecordType": "C" }, "avm": { "finalValue": 2367000.0, "highValue": 2924000.0, "lowValue": 1916000.0, "confidenceScore": 78, "standardDeviation": 9.0, "valuationDate": "2023-05-22T00:00:00" }, "estimatedFields": { "fields": [ { "mtgEstPaymentAmount": "4315.97", "mtgEstLoanBalance": 791023, "mtgEstInterestRate": { "stringValue": "413", "value": 4.13, "impliedDecimals": 2 } } ], "faEstLotSqFt": 10314 } } var apiDictionary = getFlatObject(apiResponse) //console.log(apiDictionary) function isNumeric(value) { return /^-?\d+$/.test(value); } function getFlatObject(object) { function iter(o, p) { if (o && typeof o === 'object') { Object.keys(o).forEach(function (k) { var key = k if(isNumeric(k)){ key = Number(k) + 1 } iter(o[k], p.concat(key)); }); return; } if(o !== null && o !== undefined){ path[p.join('.').toUpperCase()] = o; } } var path = {}; iter(object, []); return path; } function checkSpecialField(key) { if(key.includes(".CODE")){ return true } else if(key.includes(".DESCRIPTION")){ return false } else if(key.includes(".STRINGVALUE")){ return true } else if(key.includes(".VALUE")){ return false } else if(key.includes(".IMPLIEDDECIMALS")){ return false } } var customMappings = { "LASTSALE.": "CURRENT", "PRIORSALE.": "PREVSALE", "LASTSALEMORTGAGES.": "CONCURRENT", "PRIORMORTGAGE.": "PREVMTG", "OPENLIEN.LIENS": "MTG" } var values = {} var esKeys = Object.keys(esDictionary) for(const [key, value] of Object.entries(apiDictionary)) { var esKey = esKeys.find(function(element) { if(key.split(".").includes(element)){ if(key.endsWith("." + element)){ return true } else{ return checkSpecialField(key) } } if(/\.\d+\./.test(key) && /\d+\w+/.test(element)){ if(key.match(/\d+/)[0] === element.match(/\d+/)[0]) { var noDigitElement = element.replace(/\d+/,'') if(key.endsWith(noDigitElement)){ return true } if(key.includes(noDigitElement)){ return checkSpecialField(key) } } } return false }) if(esKey !== undefined){ values[key] = [value, esDictionary[esKey]] //console.log(key, value, esKey, esDictionary[esKey]) } //console.assert(apiDictionary[key] == esDictionary[esKey], key + " " + esKey) var customEsKey = esKeys.find(function(element){ var mapping = Object.keys(customMappings).find(m=> key.includes(m)) if(mapping !== undefined){ var apiPrefix = mapping var esPrefix = customMappings[mapping] if(element.startsWith(esPrefix)){ if(element.endsWith(key.split(".").slice(-1))){ //console.log(element, key) return true } else if(element.endsWith(key.split(".").slice(-2, -1))){ return checkSpecialField(key) } } if(key.startsWith(apiPrefix) && element.startsWith(esPrefix) && /\.\d+\./.test(key) && /\d+\w+/.test(element)){ if(key.match(/\d+/)[0] === element.match(/\d+/)[0]) { var noDigitElement = element.replace(/\d+/,'') if(noDigitElement.startsWith(esPrefix)){ if(noDigitElement.endsWith(key.split(".").slice(-1))){ return true }else if(noDigitElement.endsWith(key.split(".").slice(-2, -1))){ return checkSpecialField(key) } } } } } }) if(customEsKey !== undefined){ values[key] = [value, esDictionary[customEsKey]] //console.log(key, value, customEsKey, esDictionary[customEsKey]) } } //console.log(values) for(const[key, value] of Object.entries(values)) { console.assert(value[0] == value[1], key + " " + value) }
Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for Javascript language. Getting started with the OneCompiler's Javascript editor is easy and fast. The editor shows sample boilerplate code when you choose language as Javascript and start coding.
Javascript(JS) is a object-oriented programming language which adhere to ECMA Script Standards. Javascript is required to design the behaviour of the web pages.
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
rl.on('line', function(line){
console.log("Hello, " + line);
});
Keyword | Description | Scope |
---|---|---|
var | Var is used to declare variables(old way of declaring variables) | Function or global scope |
let | let is also used to declare variables(new way) | Global or block Scope |
const | const is used to declare const values. Once the value is assigned, it can not be modified | Global or block Scope |
let greetings = `Hello ${name}`
const msg = `
hello
world!
`
An array is a collection of items or values.
let arrayName = [value1, value2,..etc];
// or
let arrayName = new Array("value1","value2",..etc);
let mobiles = ["iPhone", "Samsung", "Pixel"];
// accessing an array
console.log(mobiles[0]);
// changing an array element
mobiles[3] = "Nokia";
Arrow Functions helps developers to write code in concise way, it’s introduced in ES6.
Arrow functions can be written in multiple ways. Below are couple of ways to use arrow function but it can be written in many other ways as well.
() => expression
const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const squaresOfEvenNumbers = numbers.filter(ele => ele % 2 == 0)
.map(ele => ele ** 2);
console.log(squaresOfEvenNumbers);
let [firstName, lastName] = ['Foo', 'Bar']
let {firstName, lastName} = {
firstName: 'Foo',
lastName: 'Bar'
}
const {
title,
firstName,
lastName,
...rest
} = record;
//Object spread
const post = {
...options,
type: "new"
}
//array spread
const users = [
...adminUsers,
...normalUsers
]
function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo
console.log(`Hello ${name}!`);
}
greet() // Hello Foo
greet({ name: 'Bar' }) // Hi Bar
IF is used to execute a block of code based on a condition.
if(condition){
// code
}
Else part is used to execute the block of code when the condition fails.
if(condition){
// code
} else {
// code
}
Switch is used to replace nested If-Else statements.
switch(condition){
case 'value1' :
//code
[break;]
case 'value2' :
//code
[break;]
.......
default :
//code
[break;]
}
For loop is used to iterate a set of statements based on a condition.
for(Initialization; Condition; Increment/decrement){
//code
}
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while (condition) {
// code
}
Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.
do {
// code
} while (condition);
ES6 introduced classes along with OOPS concepts in JS. Class is similar to a function which you can think like kind of template which will get called when ever you initialize class.
class className {
constructor() { ... } //Mandatory Class method
method1() { ... }
method2() { ... }
...
}
class Mobile {
constructor(model) {
this.name = model;
}
}
mbl = new Mobile("iPhone");