Run once

0
Reputation

Taken from https://davidwalsh.name/essential-javascript-functions

"There are times when you prefer a given functionality only happen once, similar to the way you'd use an onload event... ...The once function ensures a given function can only be called once, thus preventing duplicate initialization!"

Version:



                            
    Kyle

    Kyle

    OneLib developer/administrator
    There is 1 person using this snippet in their library: