In this video I'll be taking you step by step in detail how I solved the "Search and Replace" challenge in 3 easy steps using javascript on FreeCodeCamp.
This is a great video to practice using regular expressions in your code and the methods that come with it.
The steps I took to complete this challenge are as follows(I go into more detail in the video):
STEP 1
Replace 'before' with 'after'.
STEP 2
Find out if the 'before' string is capitalised/
STEP 3
If it is, replace the first letter in the 'after' string with the same letter but upper case.
Useful links:
Regex101(brilliant resource for learning and validating your regex): https://goo.gl/tv3ZzZ
test(): https://goo.gl/uGxign
replace(): https://goo.gl/xUZG6D
Download
0 formats
No download links available.
FreeCodeCamp - Search and Replace - SOLVED IN 3 EASY STEPS! | NatokHD