Day Error fixes

pull/37/head
Asabeneh 6 years ago committed by GitHub
parent 4acb3acd00
commit 6d6a4ddb51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -80,12 +80,13 @@ addTwoNumbers() // function has to be called to be executed by it name
``` ```
```js ```js
function generateFullName (): function generateFullName (){
let firstName = 'Asabeneh' let firstName = 'Asabeneh'
let lastName = 'Yetayeh' let lastName = 'Yetayeh'
let space = ' ' let space = ' '
let fullName = firstName + space + lastName let fullName = firstName + space + lastName
console.log(fullName) console.log(fullName)
}
generateFullName() // calling a function generateFullName() // calling a function
``` ```
@ -94,12 +95,13 @@ addTwoNumbers() // function has to be called to be executed by it name
Function can also return values, if a function does not return values the value of the function is undefined. Let us write the above functions with return. From now on, we return value to a function instead of printing it. Function can also return values, if a function does not return values the value of the function is undefined. Let us write the above functions with return. From now on, we return value to a function instead of printing it.
```js ```js
function generateFullName (): function generateFullName (){
let firstName = 'Asabeneh' let firstName = 'Asabeneh'
let lastName = 'Yetayeh' let lastName = 'Yetayeh'
let space = ' ' let space = ' '
let fullName = firstName + space + lastName let fullName = firstName + space + lastName
return fullName return fullName
}
console.log(generateFullName()) console.log(generateFullName())
function addTwoNumbers { function addTwoNumbers {

Loading…
Cancel
Save