Write a JS class that represents a meteorological station reading. Each reading has an id, temperature, humidity, pressure and windSpeed properties which are all numbers. The ID is auto assigned and autoincremented sequentially for each instance, while the rest of the properties are set trough the constructor.
In addition, the class must include a toString() method that returns a formatted string with a summary of the information kept inside the record and a weather status. The status is either 'Not stormy' or 'Stormy', depending on the readings. For the weather to be stormy, all of these conditions must be met:
temperature bellow 20
pressure bellow 700 OR above 900
windSpeed above 25
For any other conditions, the weather is not stormy. See the examples for more formatting details. Note each property is on a new line.
Input / Output:
Only valid data will be passed to the constructor. The output is expected as a string, returned by the toString() method of your class.
Depending on how you structure your code, submit just the class definition as is, or wrapped in an IIFE that returns the class definition.
Sample Input 1:
let record1 = new Record(32, 66, 760, 12);
Reading ID: 0
Relative Humidity: 66%
Wind Speed: 12m/s
Weather: Not stormy
Sample Input 2:
let record2 = new Record(10, 40, 680, 30);
Reading ID: 1
Relative Humidity: 40%
Wind Speed: 30m/s