Functions and Control Flow
Last reviewed 25 September 2020 by Alex Seymour
Description
This session learners will be taught about how to write a function in Javascript. The learners will also have to call the function to make it run. They will be introduced to control flow and how to use logic inside of a function to return an output.
Why this is important
All functional languages follow similar rules, this session educates the learners on how to pass arguments to a function and what logic to apply to those arguments in order to return something back to the process. Understanding control flow is a huge part of the job, the learners will be taught what logic is available to them whilst problem solving.
Outcomes
Following this training you will be able to: Create functions in javascript, pass arguments to the function, apply logical code to the arguments passed in order to return something from the function.
Learner Requirements
- VS code
- Github desktop / Git CLI
Outline
- Recap Variables.
- Functions.
- Arguments.
- Returning Values.
- Demo
- Global/ Local Variables
- Control Flow
- Tasks
Tasks
Mandatory
- The learners will have a series of JS challenges to complete alongside the demos
- The learners will be given a JS challenge to complete.
Skills, Knowledge, Behaviours and Values
Core Skills
This workshop is designed to develop the following from our core skills directive
- Presentation
- Logic
- Problem Solving
- Reflection
- Research
- Learning from failure
Apprenticeship Standard
This workshop will encourage the development of the following from the Software Developer Level 4 Standard
COMPETENCIES (Skills)
- C1 - Logic: writes good quality code (logic) with sound syntax in at least one language.
- C5 - Problem solving: can apply structured techniques to problem solving, can debug code and can understand the structure of programmes in order to identify and resolve issues.
- C8 - Deployment: can understand and utilise skills to build, manage and deploy code into enterprise environments.
- C9 - Development lifecycle: can operate at all stages of the software development lifecycle, with increasing breadth and depth over time with initial focus on build and test..
- C12 - Can respond to the business environment and business issues related to software development.
BEHAVIOURS
- B1 - Logical and creative thinking skills.
- B2 - Analytical and problem-solving skills.
- B3 - Ability to work independently and to take responsibility.
- B7 - Ability to communicate effectively in a variety of situations.
- B8 - Maintain productive, professional and secure working environment.
Knowledge
- K1 - Understands and operates at all stages of the software development lifecycle.
- K3 - Understands how teams work effectively to produce software and contributes appropriately.
- K4 - Understands and applies software design approaches and patterns and can interpret and implement a given design, compliant with security and maintainability requirements.
- K5 - Understands and responds to the business environment and business issues related to software development.