This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | let value = "12AB34";//given string | |
| let val1 = value.split("");//split string | |
| //filter out the character and keep numbers | |
| let val2 = val1.filter(c =>{ | |
| if (c >= '0' && c <= '9') { | |
| return c; | |
| } | |
| }); | |
| //sum all the numbers in array | |
| let sum = 0; |