Skip to content
Advertisement

Conversion of string to upper case without inbuilt methods

I am trying to perform conversion from a lowercase to uppercase on a string without using any inbuilt functions (other than ord() and char()). Following the logic presented on a different thread here , I came up with this.

JavaScript

However I am getting an error output: TypeError: ord() expected a character, but string of length 8 found.What am I missing here?

Advertisement

Answer

You need to execute ord() for each character of your input string. instead of the input string:

JavaScript

Without join:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement