MCPcopy Create free account
hub / github.com/AyushSaini00/60minuteJavaScript / checkCategory

Function checkCategory

BMI-Calculator/app.js:20–47  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

18
19//DESCRIPTION ACCORDING TO BMI CATEGORY
20function checkCategory(value){
21 if(isFinite(value)){
22 if(value >= 30.0){
23 bmiCategoryElem.style.color = '#b00';
24 bmiElem.style.color = '#b00';
25 bmiElem.style.borderColor = '#b00';
26 return `Obese`;
27 }else if(value >= 25.0 && value <= 29.9){
28 bmiCategoryElem.style.color = '#8a4f02';
29 bmiElem.style.color = '#8a4f02';
30 bmiElem.style.borderColor = '#8a4f02';
31 return `Overweight`;
32 }else if(value >= 18.5 && value <= 24.9){
33 bmiCategoryElem.style.color = '#2ca1bc';
34 bmiElem.style.color = '#2ca1bc';
35 bmiElem.style.borderColor = '#2ca1bc';
36 return `Normal`;
37 }else if(value <= 18.4) {
38 bmiCategoryElem.style.color = '#625301';
39 bmiElem.style.color = '#625301';
40 bmiElem.style.borderColor = '#625301';
41 return `Underweight`;
42 }
43 }else {
44 bmiCategoryElem.style.color = 'black';
45 return ``;
46 }
47}
48
49//UPDATING UI
50function updateUI(){

Callers 1

updateUIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected