Download presentation
Presentation is loading. Please wait.
Published byPetter Edvin Pettersen Modified over 5 years ago
1
Functions MIS 3406 Department of MIS Fox School of Business
Temple University
2
What is a function in Excel?
=TODAY() =NOW() =SUM(A1+B1) =AVERAGE(A1:A10) =MIN(A1:A10) =MAX(A1:A10) All functions Have a name Are passed zero or more pieces of information Return a value
3
What is a function in Node.js?
A way to organize your code to make it easier to create and maintain All functions Have a name Are passed zero or more pieces of information Return a value (usually) Main program just does basic input/output. All of the real work is packaged up and performed in functions
4
A Simple Function Function Main Routine
5
A Function That Takes Arguments
Accepting Arguments Passing Arguments
6
A Function That Returns Data
Value returned by function Call function and pass arguments Processing value returned
7
Variable Scope Local variable “distance” Global variable “distance”
8
Challenges KilometerConverter SalesTax HowMuchInsurance
AutomobileCosts PropertyTax Calories StadiumSeating PaintJobEstimator MonthlySalesTax FeetToInches MaximumOfTwoValues FallingDistance KineticEnergy TestAverageAndGrade EvenOddCounter PrimeNumber1 PrimeNumber2 FutureValue RockPaperScissors
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.