Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Function for masking the character

<script>
    // Function for masking the character 
    function MaskCharacter(str, mask, n = 1) {
  
        // Slice the string and replace with
        // mask then add remaining string
        return ('' + str).slice(0, -n)
            .replace(/./g, mask)
            + ('' + str).slice(-n);
    }
  
    // Number that we want to mask 
    var num = 12345678;
  
    // Convert number into string
    var str = num.toString();
  
    // Call function without giving value of n
    console.log(MaskCharacter(str, '#'));
  
    // Call function with value of n
    console.log(MaskCharacter(str, '#', 2));
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: playwrigth await browser 
Javascript :: Public properties can be created via Static public fields 
Javascript :: javascriot html eqaul to jquery 
Javascript :: strapi extend user model 
Javascript :: how to get 4 columns with masonryjs 
Javascript :: min expression postgresql 
Javascript :: acced to unknown obkect key js 
Javascript :: desctructuring in react with aliases 
Javascript :: datatable editable row update other cell 
Javascript :: how can click div close and open next day jquery 
Javascript :: Electron manage windows 
Javascript :: url.createobjecturl 
Javascript :: Quitar objetos duplicados 
Javascript :: react weather app 
Javascript :: Example to adds two colour palettes to the sidebar in wordpress 
Javascript :: blur area behind an element in react native 
Javascript :: format file using jq 
Javascript :: Determining Truth With Logical Operators 
Javascript :: regular expression for twitter embedded tweets 
Javascript :: Show / Hide Div On Radio Button Click angular 
Javascript :: How do you convert VARCHAR to TIMESTAMP 
Javascript :: x is not a function javascript type error 
Javascript :: create trigger to run every minute in apps script 
Javascript :: how to add carsoul to react project 
Javascript :: javascript display block div 
Javascript :: makestyle server side rendering 
Javascript :: js collection 
Javascript :: javascript chessboard embedding 
Javascript :: electron frameless Draggable move 
Javascript :: error-too-many-re-renders-react-limits-the-number-of-renders-to-prevent 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =