Trim lines of code

Fixes the bug where the strings won't match even if the user types the
trailing space as angular trims the model variable.

Signed-off-by: Thameera Senanayaka <thameera123@gmail.com>
JS: snippets for functions, strings, arrays

Signed-off-by: Thameera Senanayaka <thameera123@gmail.com>