Sure, here's an overview of each JavaScript function without the HTML interface part:
- JavaScript Function (
calculerSomme()
):- Retrieves the values entered in the input fields.
- Converts the values to integers and calculates their sum.
- Updates the content of an element with the calculated sum.
- JavaScript Function (
swapValues()
):- Retrieves the values entered in two input fields.
- Swaps the values between the two input fields.
- JavaScript Function (
separateName()
):- Retrieves the full name entered in an input field.
- Separates the full name into last name and first name using
indexOf()
andslice()
functions. - Updates the content of separate elements with the separated last name and first name.
- JavaScript Function (
calculerValeurAbsolue()
):- Retrieves the value entered in an input field.
- Calculates the absolute value using the
Math.abs()
function. - Updates the content of an element with the calculated absolute value.
- JavaScript Function (
calculer()
):- Retrieves the values entered in two input fields and the selected operation.
- Performs the selected arithmetic operation (+, -, *, /) on the two numbers.
- Updates the content of an element with the calculated result.
These JavaScript functions are designed to perform specific tasks as part of the exercises, such as calculation, value manipulation, and result display, without directly interacting with the HTML interface.