for function js

JavaScript
function MyApp() {
  return (
    <div>
      <ul>
        <li>Name </li>
        <li>Place </li>
        <li>Animal </li>
      </ul>
    </div>
  )
}

ReactDOM.render(
  <MyApp />,
  document.getElementById('root')
);<?php
function writeMsg() {
    echo "Hello world!";
}

writeMsg(); //call the function
?>/* Declare function */
function myFunc(param) {
  // Statements 
}function idk() {
	alert('This is an alert!')
}
//call the function to make the function run by saying "Name of function + ()"
idk()def function_name():
  passfor (statement 1; statement 2; statement 3) {
  // code block to be executed
}
var i;
for (i = 0; i < cars.length; i++) {
  text += cars[i] + "<br>";
}
Source

Also in JavaScript: