im about to make a program that the output obtain the domain of the email. how to do that without built-in function such as .map .filter .reduce .split .join .indexOf .findIndex .substring i do search and many answer said i have to use for loop, i can find the "@" and find the "." but how to make those string between "@" and "." to be an output
ex: input = [email protected] output = gmail
input = [email protected]
output = yahoo
let input = "[email protected]"
let output = ""
let begin = ""
let end = ""
for (let i = 12; i<input.length; i++){
if(input[i] == "@"){
begin += input[i+1]
}
}
for (let j = 0; j<input.length; j++){
if(input[j] == "."){
end += input[j-1]
}
}