-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBmiCal.js
More file actions
36 lines (29 loc) · 775 Bytes
/
Copy pathBmiCal.js
File metadata and controls
36 lines (29 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var mark ={
nameMark :'mark',
massMark:'50',
heightMark :'1.8',
BmiMark: function (){
return (this.massMark/(this.heightMark*this.heightMark))
}
}
var john ={
nameJhon :'john',
massJohn:'50',
heightJohn :'1.8',
BmiJohn :function (){
return (this.massJohn/(this.heightJohn*this.heightJohn))
}
}
var markBMI= mark.BmiMark()
console.log(mark)
console.log("Mark BMI :"+markBMI)
var johnBMI= john.BmiJohn()
console.log(john)
console.log("John BMI"+johnBMI)
if(markBMI>johnBMI){
console.log(mark.nameMark+" "+'is higher BMI :'+markBMI )
}else if (markBMI<johnBMI){
console.log(john.nameJhon+" "+'is higher BMI :'+johnBMI )
}else {
console.log('both have same BMI')
}