- Basic Data Types and Operators (String, Number, +, -)
- Variables (Declaration, Assignment, Naming rules)
- Compound Expressions (%, ++, --, +=)
- Boolean data type and logical operators (or, and, not)
- If/else and Ternary Operator
- Functions
- Arrays and Loops
- Objects
- Array and String Methods
Write a function that accepts two strings and checks if the first string is an anagram of the second string. If they are anagrams it returns true, otherwise it returns false. The case(upper/lower) of the characters DOES NOT MATTER.
function checkAnagram(word1, word2){
// write your code here
}
console.log(checkAnagram("silent", "liSten")); // true
console.log(checkAnagram("stressed", "DesertsS")); // true
Given a person's age and a day ,write the code for the following scenario:
If the person is an Adult (age >=18) , the ticket price on Weekends is 100 and on weekdays is 80.
If the person is a child (age <18), the ticket price is always half of the adult price for that particular day.
CODE TEMPLATE
- Please watch the following video to understand the Bubble Sort Algorithm
If the input is [6,2,9,5,1,3] the steps are:
compare 6 and 2 - swap
compare 6 and 9 - no change
Write a function that sorts a given array using the Bubble Sort Algorithm and returns the sorted Array. For eg.
bubbleSort([1,5,3,0])
should return [0,1,3,5]
bubbleSort([-1,0,-5,5,8])
should return [-5,-1,0,5,8]
-
Complete the set up by or before the deadline mentioned in the enrollment email
-
If you have any problem in the set up you must tell us on Discord along with a clear description of the problem.
let age = 23;
let day = 'Monday';
let price;
if (age <= 12) {
price = 50;
}
if (age >= 65) {
if (day === 'Saturday' || day === 'Sunday') {
price = 70;
Day 1
In-class challenges | Homework | freeCodeCamp |
---|---|---|
There is an array of boxes where each element of an array represents the number of boxes stacked on top of each other in that column.
For eg. boxes=[4,1,2,3,2,1]
.
This is a row of boxes where the first column of boxes has 4 boxes stacked on top of each other. The second column has 1 box, the third column has 2 boxes stacked on top of each other and the fourth column has 3 boxes stacked on top of each other and so on. So the boxes look like this:
B
B B
B B B B