<commit_before>"use-strict";

class Trinary{
    constructor(number){
        this.number = number;
    }

    
}<commit_msg>add trinary solution<commit_after>"use-strict";

class Trinary{
    constructor(number){
        this.number = number;
    }

    /**Converts given trinary number to decimal
     * by first principles.
     */
    toDecimal(){
        // split and reverse the array of numbers
        var list = this.number.split("").reverse();
        var sum = 0;
        for(var x = 0;x < list.length; x++){
            sum+= +list[x] * Math.pow(3, x);
        }
        return sum;
    }
}
{'fraction_non_alphanumeric': 0.1345514950166113, 'fraction_numerical': 0.0049833887043189366, 'mean_word_length': 2.015, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '353919', 'n_tokens_mistral': 187, 'n_tokens_neox': 181, 'n_words': 48}