/challenge-2-fe

Studi Independen Binar Academy - Frontend JavaScript

Primary LanguageJavaScript

Challenge 2 - Binar Academy Frontend JavaScript | Studi Independen Kampus Merdeka

To run test make sure to install the dependencies first using npm install or yarn and then run npx vitest

There is 8 questions from this challenge, here's the lists:

Change Word

Create a function that accepts 3 parameters with string data type, selectedText, changedText, text

  • selectedText is a word that is gonna be changed
  • changedText is a word that will replace the selectedText
  • text is the string or the sentence

Check Even or Odd Number

Create a function to check a number is Even or Odd, this function is accepting 1 parameter with number data type

Criteria

  • This function is returning string
  • If given argument is valid, this function should return either "GENAP" or "GANJIL"
  • Validation if argument is not number data type

Email Validation

Create a function to check if given parameter is valid email address, this function is accepting 1 parameter called email which is string data type

Criteria

  • This function should return string
  • This function validate the given argument

Password Validation

Create a function to check if given parameter is valid password, this function is accepting 1 parameter called givenPassword with string data type

Criteria

  • Password length should be at least 8
  • Password should have 1 lowercase letter
  • Password should have 1 uppercase letter
  • Password should have 1 number
  • Validate given argument
  • This function return boolean

Split Name

Create a function to return object

Second highest

Get Sum of Array of Objects

Get selling summary