in react javascript function is used to add additional functionality to any of the existing component code example
Example: class app extends component syntax
class Welcome extends React.Component {
render() {
return Hello, {this.props.name}
;
}
}