Pseudo code is a term which is often used in
programming and algorithm based fields. It is a
methodology that allows the programmer to
represent the implementation of an algorithm.
Simply, we can say that it’s the cooked up
representation of an algorithm .
Example of Pseudocode
Pseudocode is a very intuitive way to develop
software programs. To illustrate this, I am going
to refer back to a very simple program I wrote in
my:
When a user fills in a form and clicks the submit
button, execute a ValidateEmail function. What
should the function do?
1. Derive an email regular expression
(regex) to test the user's email address
against.
2. Access the user's email from the DOM
and store it in a variable. Find and use the
right DOM method for that task.
let database = ['test1@[Link]',
'test2@[Link]', 'test3@[Link]'];
function validateEmail() {
let regexEmail = /^\w+([.-]?\w+)@\w+
([.-]?\w+)(.\w{2,3})+$/;
let emailAddress =
[Link]('emailFld').value;
if ()
{
[Link]('myAlert').innerHT
ML = "Invalid Email!";
} else if
([Link](emailAddress)) {
[Link]('myAlert').innerHT
ML = "Email exists!";
else {
[Link](emailAddress);
[Link]('myAlert').innerHT
ML = "Successful!";
return true;
}
}
[Link]("myBtn").addEvent
Listener("click", validateEmail);