function stringToArray(str) {
        var arr = [];
        for (let char of str) {
            arr.push(char);
        }
        return arr;
    }
converts a string to an array of characters
@param {string} str - the input string
@returns {Array} - the array of characters