Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 코드스쿨
- Code school
- 송도버스시간표
- 함수선언문
- 테드대본
- 자바스크립트
- GIT
- 코딩 공부
- function expression
- exerd
- 헤어브러쉬추천
- 깃 설치
- 리액트
- react js
- 생활코딩
- props
- 직장인마우스
- install
- 탱글티저웻디탱글러
- 자바스크립트 함수
- 함수표현식
- 인프런
- 머리빗추천
- ERD
- 데이터베이스
- window
- javascript
- function declaration
- 윈도우
- relationship
Archives
- Today
- Total
J's Rhapsody
[Javascript]문제 1.3: Using Function Expressions with Parameters 본문
IT/JAVASCRIPT
[Javascript]문제 1.3: Using Function Expressions with Parameters
J's Rhapsody 2018. 1. 11. 13:01Using Function Expressions with Parameters
The devs at the Death-Defying Dogwoods have determined a specific formula for the quantifiable amount of fear generated at the theme park. Their formula is based on the amount of people, the amount of rain, and the amount of sharks. Yes. Sharks.
- Analyze the
fearGenerated
formula. - Assign appropriate values to the
people
, rain
, and sharks
variables so that the amount of fear generated will be no less than 100
, but no more than 400
. - Call the
fearGenerated
function and pass in the variables as arguments. - Store the result of that function in a new variable called
fear
.
Note: You do not need to change the existing fearGenerated
function.
123456789101112 var people = 100;var rain = 2;var sharks = 3; var fearGenerated = function(numPeeps, rainInInches, numSharks) { var rainFear = numPeeps * rainInInches; var sharkFear = numSharks * numSharks * numSharks; var totalFear = sharkFear + rainFear; return totalFear;}; var fear = fearGenerated(people, rain, sharks); cs
The devs at the Death-Defying Dogwoods have determined a specific formula for the quantifiable amount of fear generated at the theme park. Their formula is based on the amount of people, the amount of rain, and the amount of sharks. Yes. Sharks.
- Analyze the
fearGenerated
formula. - Assign appropriate values to the
people
,rain
, andsharks
variables so that the amount of fear generated will be no less than100
, but no more than400
. - Call the
fearGenerated
function and pass in the variables as arguments. - Store the result of that function in a new variable called
fear
.
Note: You do not need to change the existing fearGenerated
function.
1 2 3 4 5 6 7 8 9 10 11 12 | var people = 100; var rain = 2; var sharks = 3; var fearGenerated = function(numPeeps, rainInInches, numSharks) { var rainFear = numPeeps * rainInInches; var sharkFear = numSharks * numSharks * numSharks; var totalFear = sharkFear + rainFear; return totalFear; }; var fear = fearGenerated(people, rain, sharks); | cs |
'IT > JAVASCRIPT' 카테고리의 다른 글
[Javascript]문제 1.5: Functions as Parameters, Arguments and Return Values (0) | 2018.01.11 |
---|---|
[Javascript]문제 1.4: Displaying Function Contents (0) | 2018.01.11 |
[Javascript]문제 1.2: Changin Declarations to Expressions (0) | 2018.01.11 |
[Javascript]Function Expressions (0) | 2018.01.11 |
Comments