![]() |
Mobile Development and JavaScript | Coursera Meta |
This course marks the beginning of a series aimed at Android developers seeking to diversify into cross-platform mobile development. It emphasizes leveraging existing Android development skills to create applications that run on multiple platforms. The initial phase focuses on mastering JavaScript programming, a fundamental requirement for utilizing the React library in mobile development.
JavaScript is renowned as the backbone of modern web technology. Participants will delve into essential web development concepts through practical exercises covering functions, objects, arrays, variables, data types, and the HTML DOM, among other key elements. The course also explores advanced interactive capabilities offered by contemporary JavaScript technologies and introduces methodologies for testing code, including hands-on experience in writing unit tests using Jest.
Completion of this course contributes towards various Specialization or Professional Certificate programs, including the Meta Android Developer Professional Certificate and the Meta iOS Developer Professional Certificate. By the course's conclusion, learners will be proficient in explaining foundational web development principles with JavaScript, applying JavaScript within the React framework, and conducting effective code testing using Jest.
Notice!
Always refer to the module on your course for the most accurate and up-to-date information.
Attention!
If you have any questions that are not covered in this post, please feel free to leave them in the comments section below. Thank you for your engagement.
Module Quiz: Introduction to JavaScript
- Installing npm.
- Testing your code.
- Running Javascript in a web browser.
- Downloading packages.
- multi-line comments
- inline comments
- unfinished code
- test code
- numbers
- string
- booleans
- function
- ||
- &
- &&
- \
- NOT
- Assignment
- AND
- Equality
for(var i = 10; i >=1; i--) { console.log("Hello"); }
- 1
- 10
- 0
- 9
var i = 3; var j = 5; if(i == 3 && j == 5) { console.log("Hello"); } else { console.log("Goodbye"); }
- undefined
- Goodbye
- Nothing
- Hello
var i = 7; var j = 6; if(i < 7 || j < 5) { console.log("Hello"); } else { console.log("Goodbye"); }
- Hello
- undefined
- Goodbye
- Nothing
- false
- true
- undefined
- syntaxError
var year = 2018;while (year < 2023) {console.log(year);year++;};
- It will log the years 2018 until 2023.
- undefined
- It will log the years 2018 until 2022.
- year = 2023
Module Quiz: The Building Blocks of a Program
const car = {type:"Ford", model:"Model T", color:"white"};
- type
- car
- model
- color
- TypeError
- RangeError
- ReferenceError
- SyntaxError
var burger = ["bun", "beef", "lettuce", "tomato sauce", "onion", "bun"]; burger.pop()
- It turns burger into an object.
- It will remove the last bun from the array.
- It will remove the first bun from the array.
- It has no effect.
var bicycle = { wheels: 2, start: function() { }, stop: function() { } };
- Method
- Array
- Property
- Object
try { throw new Error(); console.log('Hello'); } catch(err) { console.log('Goodbye'); }
- Hello
- Goodbye
- err
- catch failed
- RangeError
- ReferenceError
- TypeError
- SyntaxError
(10).toString(100);
- undefined
- RangeError
- .1
- SyntaxError
const value = null;console.log(value);
- null
- error
- value
- undefined
var str = "Hello"; str.match("jello");
- null
- undefined
- SyntaxError
- “”
- try
- throw
- err
- ErrorHandling
Module Quiz: Programming Paradigms
Random 1
- var
- const
- let
- There are no variable declarations which cannot be reassigned.
function scopeTest() { var y = 44; console.log(x); }scopeTest();var x = 33;
- 44
- undefined
- 33
- null
class Cake {constructor(lyr) { this.layers = lyr;}getLayers() { return this.layers; }class WeddingCake extends Cake {constructor() { super(2); } getLayers() { return super.getLayers() * 5; }}var result = new WeddingCake();console.log(result.getLayers());
- WeddingCake cannot be updated and throws an error.
- The constructor is not passed an initial argument and the Console.log will print undefined.
- Console.log will print 2.
- WeddingCake overrides the getLayers() function to multiply the result by 5.
class Animal { }class Dog extends Animal {constructor() { this.noise = "bark"; }makeNoise() { return this.noise; }}class Wolf extends Dog {constructor() { super(); this.noise = "growl"; }}var result = new Wolf();console.log(result.makeNoise());console.log(result.makeNoise()) will log undefined
- growl is replaced by bark as the output of console.log(result.makeNoise())
- syntaxError
- bark is replaced by growl as the output of console.log(result.makeNoise())
const [a, b, …rest] = [1,2,3,4]
- undefined
- [3,4]
- 2
- 1
function count(...food) { console.log(food.length) } count("Burgers", "Fries", null);
- "Burgers", "Fries", undefined
- 3
- "Burgers", "Fries", null
- 2
- Sources tab
- You cannot access the Document Object Model from your web browser.
- Elements tab
- Console tab
- JSON.fromString
- JSON.stringify
- JSON.toString
- JSON.parse
var letter = "a";letter = "b";console.log(letter);
- a
- Uncaught SyntaxError: Invalid or unexpected token
- b
- Uncaught TypeError: Assignment to constant variable
- Extends
- New
- Function
- Construct
Random 2
- const
- let
- var
- There are no variable declarations which can be redeclared and reassigned.
function scopeTest() { var y = 44; console.log(x); }var x = 33;scopeTest();
- undefined
- null
- 44
- 33
class Cake {constructor(lyr) { this.layers = lyr;}getLayers() { return this.layers; }class WeddingCake extends Cake {constructor() { super(2); } getLayers() { return super.getLayers() * 5; }}var result = new WeddingCake();console.log(result.getLayers());
- 0
- 2
- 10
- 5
class Animal { }class Dog extends Animal {constructor() { this.noise = "bark"; }makeNoise() { return this.noise; }}class Wolf extends Dog {constructor() { super(); this.noise = "growl"; }}var result = new Wolf();console.log(result.makeNoise());
- bark
- growl
- syntaxError
- undefined
let a, b, rest;[a, b, ...rest] = [1,2,3,4]
- console.log(...rest)
- console.log(rest)
- console.log(c+d)
- console.log(c,d)
function count(...food) { console.log(food.length) } count("Burgers", "Fries", null);
- 2
- "Burgers", "Fries", undefined
- "Burgers", "Fries", null
- 3
- Console tab
- Sources tab
- You cannot access the Document Object Model from your web browser.
- Elements tab
- JSON.fromString
- JSON.toString
- JSON.parse
- JSON.stringify
let letter = "a" letter = "b";console.log(letter);
- a
- b
- Uncaught TypeError: Assignment to constant variable
- Uncaught SyntaxError: Invalid or unexpected token
- An object literal.
- A specific object that has been created using the class name.
- A function that is called to create an instance of an object.
- An instance of a class.
Module Quiz: Testing
- JFrame
- JavaFrame
- JavaTest
- Jest
function multiply(a, b) { return a; } expect(multiply(2, 2)).toBe(4);
- True/False
- String
- Success/Fail
- Function
- Post-hoc testing.
- Unit testing.
- Integration testing.
- End-to-end testing.
- TestMeasure
- Test coverage
- Code coverage
- Test%
- Download and manage packages
- Estimate code coverage
- Write full-stack JavaScript programs.
- Run unit tests
- Post-hoc testing
- Integration testing
- End-to-end testing
- Unit testing
- npm
- node
- pkg
- package
- Turn your code into an application.
- Download npm packages.
- Store all the dependencies required for application.
- Store all the testing code.
- You have proof that your new implementation is not breaking other parts of the app.
- You can run tests without setting them up.
- Minimizing regressions like accidental bugs introduced to old code.
- You can automate these tests easily and thus keep verifying again and again that the system works as expected.
- Mocking
- End-to-end testing
- Fakes
- module.exports
Final Graded Quiz: Programming with JavaScript
const a = 2;const b = 4;if(a == 2 && b == 8) { console.log("Green"); }else { console.log("Blue"); }
- Green
- null
- Blue
- syntaxError
var message = "Hello";message += " World!";message = "Goodbye!";console.log(message);
- Goodbye!
- Hello
- Hello World!
- World!
var x = "Hello";
- BigInt
- String
- Boolean
- Number
var x = 20;if(x >= 10) {console.log("Apple");}else if(x <= 5) {console.log("Pear");}else { console.log("Orange"); }
- Pear
- undefined
- Apple
- Orange
var result = 0;var i = 0;var limit = 3;while(i < limit) {result += 2; i++;}console.log(result);
- 0
- 3
- 2
- 6
try { throw new Error(); console.log('Square'); }catch(err) { console.log('Circle'); }
- undefined
- Square
- Circle
- sytaxError
function(a,b){ return a + b }
- The assignment operator.
- The dot notation.
- The function name.
- The bracket notation.
var cat = {}cat.sound = "meow";var catSound = "purr"console.log(catSound)
- catSound
- meow
- purr
- {}
var veggies = []veggies.push('parsley')veggies.push('carrot')console.log(veggies[2])
- 3
- 1
- undefined
- 2
- The target of the event.
- The name of the method.
- A string describing the type of event (such as, ‘click’).
- A function that will handle the event.
- With document.createElement('h2')
- With document.addElement('h2')
- With document.buildElement('h2')
- True
- False
- Testing your code.
- Downloading packages.
- Running Javascript in a web browser.
- Installing npm.
- test code
- inline comments
- multi-line comments
- unfinished code
- booleans
- numbers
- function
- string
- ===
- =>
- =
- ==
- End-to-end testing
- Unit testing
- Integration testing
- Post-hoc testing
- False
- True.
- False
- True
- False
- True
- Jest Fakes
- Jest Snapshot
- Jest Mock functions
- External mock libraries
- You can run tests without setting them up.
- You have proof that your new implementation is not breaking other parts of the app.
- You can automate these tests easily and thus keep verifying again and again that the system works as expected.
- Minimizing regressions like accidental bugs introduced to old code.
- var
- const
- let
- There are no variable declarations which cannot be reassigned.
class Game {constructor(score) {this.score = points; }getPoints() { return this.score; }class Bonus extends Game {constructor() { super(2);}getpoints() { return super.getPoints() * 5; }var result = new Bonus();console.log(result.getPoints());
- 5
- 2
- 10
- 0
class Animal { }class Cat extends Animal {constructor() { this.noise = "meow"; }makeNoise() { return this.noise; }class Tiger extends Cat {constructor() { super(); this.noise = "growl"; }var result = new Tiger();console.log(result.makeNoise());
- growl
- meow
- syntaxError
- undefined
let a, b, rest;[a, b, ...rest] = [1,2,3,4]
- console.log(c+d)
- console.log(c,d)
- console.log(...rest)
- console.log(rest)
- False
- True
- JSON.fromString
- JSON.stringify
- JSON.parse
- JSON.toString
- New
- Extends
- Construct
- Function
- Pure functions and side-effects
- First-class functions
- Objects
- Higher-order function