param { string } num1 param { string } num2 return { string } function StringMultiply ( num1 , num2 ) { if ( typeof num1 !== 'string' || typeof num2 !== 'string' || num1 . length === 0 || num2 . length === 0 ) { return "" ; } let len1 = num1 . length ; let len2 = num2 . length ; let result = new Array ( len1 + len2 ) . fill ( 0 ) ; for ( let i = len1 - 1 ; i >= 0 ; -- i ) { for ( let j = len2 - 1 ; j >= 0 ; -- j ) { let bitmul = ( parseInt ( num1 [ i ] ) ) * ( parseInt ( num2 [ j ] ) ) ; bitmul += result [ i + j + 1 ] ; result [ i + j ] += Math . floor ( bitmul / 10 ) ; result [ i + j + 1 ] = bitmul % 10 ; } } let index = 0 ; while ( index < result . length - 1 && result [ index ] === 0 ) { index ++ ; } return result . slice ( index ) . join ( '' ) ; } export { StringMultiply } ;