I am a QA engineer. My work is primarily focused on improving quality of Web application. I’m here because I want to upgrade my skills in writing code.
The instruction was next: “Create a function which allows to split general sentence from question”
The solution that I made:
const getTypeOfSentece = (sentence) => {
const lastChar = sentence[sentence.length - 1];
if (lastChar === '?') {
return 'question';
} else if (lastChar === '!') {
return 'exclamation!';
} else
return 'general';
}
Belarusian State University of Informatics and Radioelectronics
Faculty of Radioengineering and Electronics
Specialty: Solid-State Electronics, Radioelectronic Components, Micro- and Nanoelectronics, Quantum Effect Devices
Master of Science in Engineering