0% found this document useful (0 votes)
367 views4 pages

JS-A.S.A101 (Types and Coercion)

This document contains a training assignment on front-end advanced topics. The assignment includes 4 problems to evaluate types, coercion, and functions in JavaScript. Problem 1 and 2 ask the learner to evaluate code snippets and predict the output. Problem 3 requires writing a function to convert strings between snake_case and PascalCase. Problem 4 asks the learner to write a function that multiplies two numbers together and returns the product as a string, accounting for large numbers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
367 views4 pages

JS-A.S.A101 (Types and Coercion)

This document contains a training assignment on front-end advanced topics. The assignment includes 4 problems to evaluate types, coercion, and functions in JavaScript. Problem 1 and 2 ask the learner to evaluate code snippets and predict the output. Problem 3 requires writing a function to convert strings between snake_case and PascalCase. Problem 4 asks the learner to write a function that multiplies two numbers together and returns the product as a string, accounting for large numbers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Front-end Advanced

Trai ni ng Assi gnment

Document Code 25e-BM/HR/HDCV/FSOFT

Version 1.1

Effective Date 7/1/2019

Hanoi, mm/yyyy
Training Assignments Front-end Advanced Issue/Revision: x/y

RECORD OF CHANGES

No Effective Date Change Description Reason Reviewer Approver

1 30/May/2019 Create a new assignment Create new DieuNT1 VinhNV

2 07/Jun/2019 Update Fsoft Template Update DieuNT1 VinhNV

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 2/4


Training Assignments Front-end Advanced Issue/Revision: x/y

Contents
Unit 1: Types and Coercion.............................................................................................................................. 4
Objectives:................................................................................................................................................ 4
Problem 01............................................................................................................................................... 4
Problem 02............................................................................................................................................... 4
Problem 03............................................................................................................................................... 4
Problem 04............................................................................................................................................... 4

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 3/4


Training Assignments Front-end Advanced Issue/Revision: x/y

CODE: JS-A.S.A101
TYPE: Medium
LOC: N/A
DURATION: 120

Unit 1: Types and Coercion


Objectives:
 Understand Advanced JavaScript concepts such as: Types, Number, Coercion
Problem 01
Evaluate the following code, what is the output?

1. function empty(o) {
1. o = null;
2. }
3.
4. var x = [];
5. empty(x);
6. console.log(x); // ??
Problem 02
Evaluate the following code, what is the output?

1. function swap(a, b) {
2. var tmp = a;
3. a = b;
4. b = tmp;
5. }
6.
7. var x = 1;
8. var y = 2;
9.
10. swap(x, y);
11. console.log(x); // ??

Problem 03
Write a function reverse that takes a string s from snake_case to PascalCase
Example:
reverse(‘user_name’) == ‘UserName’ // true
Problem 04
Write a function mul that takes 2 numbers return the product of those 2 as string.
The first number can be very large.
The second number is from 1 to 99.
Example:
mul(123456789101112, 89) == ‘1098765422999897957’

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 4/4

You might also like