/* function to calculate the ideal weight from males and female */ function idealWeight(height, gender) { if (gender == 'male') { return (height - 100) * 0.9; } else { return (height - 100) * 0.85; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter