You can easily calculate Body Mass Index (Lightning Web Component). Here I have created a function called bmiCalculatorFunction.js and it can be used in multiple Lightning Web Components to calculate BMI.
In this module, you use Visual Studio Code (VS Code) to edit code. Open VS Code and clone this GitHub repo.
- In VS Code, open the Command Palette by pressing Ctrl+Shift+P (Windows) or Cmd+Shift+P (macOS).
- Enter git.
- Select Git: Clone.
- Enter https://github.com/sunil-sfdc/BMI-Calculator.git and press Enter.
- Select Desktop then click Select Repository Location.
- Open the Command Palette
- Enter sfdx.
- Select SFDX: Create Project.
- Select Standard.
- Enter BMI Calculator as the project name.
- Press Enter.
- Select Desktop for folder to store the project.
- Click Create Project.
- Click Overwrite.
Authorize Your Trailhead Playground
- Open the Command Palette
- Enter sfdx.
- Select SFDX: Authorize an Org.
- Press Enter to accept the Project Default login URL option.
- Press Enter to accept the default alias. This opens the Salesforce login in a separate browser window.
- Log in using your Trailhead Playground credentials. If prompted to allow access, click Allow.
- Right-click the default folder under force-app/main.
- Click SFDX: Deploy Source to Org.