Skip to content

Commit

Permalink
Básico de Arrow function.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSimao committed Jul 4, 2023
1 parent 0303905 commit b7809f1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Exercicios/ex010/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>Arrow function</h1>

<script src="index.js"></script>
</body>
</html>
16 changes: 16 additions & 0 deletions Exercicios/ex010/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

// Função Normal
function soma(n1,n2){
return n1 + n2
}
console.log(`Soma ${soma(5,6)}`)

// Arrow Function
const sub = (n1,n2) => {
return n1 - n2
}
console.log(`Sub ${sub(50,6)}`)

// Retornando um valor sem o return
const mult = (n1,n2) => n1 * n2
console.log(`Mult ${mult(4,6)}`)

0 comments on commit b7809f1

Please sign in to comment.