What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-12 20:20:10
match height jquery
var matchHeight = function(classe, perLine) { var peeps = $(String(classe)+":visible").css('height','auto').get(); var line = isNaN(perLine) ? peeps.length : parseInt(perLine); for(var i = 0;i<peeps.length;i=i+line) { var height = 0... Add solution -
Javascript 2022-03-10 07:15:09
javascript code speed test
var iterations = 1000000; console.time('Function #1'); for(var i = 0; i < iterations; i++ ){ functionOne(); }; console.timeEnd('Function #1') console.time('Function #2'); for(var i = 0; i < iterations; i++ ){ functionTwo(); }; console.timeE... Add solution -
Javascript 2022-03-07 21:50:11
How to add a property at the middle of an object in javascript
// Main Code Using Function: var addToObject = function (obj, key, value, index) { // Create a temp object and index variable var temp = {}; var i = 0; // Loop through the original object for (var prop in obj) { if (obj.hasOwnProperty(prop)) { ... Add solution -
Other 2022-03-03 05:45:31
signaure pad convert to img
const dataURL = this.signaturePad.toDataURL('image/png'); const data = atob(dataURL.substring('data:image/png;base64,'.length)), asArray = new Uint8Array(data.length); for (var i = 0, len = data.length; i < len; ++i) { asArray[i] = data.charCodeAt... Add solution -
Javascript 2022-02-28 11:45:17
get all visible text on website javascript
function isHidden(el) { var style = window.getComputedStyle(el); return ((style.display === 'none') || (style.visibility === 'hidden')) } // get the body tag var body = document.querySelector('body'); // get all tags inside body var allT... Add solution -
Javascript 2022-02-21 21:20:10
count number of each element in array javascript
var arr = [5, 5, 5, 2, 2, 2, 2, 2, 9, 4]; var counts = {}; for (var i = 0; i < arr.length; i++) { var num = arr[i]; counts[num] ? counts[num] + 1 : 1; } console.log(counts[5], counts[2], counts[9], counts[4]); Add solution -
Javascript 2022-02-16 19:10:10
quiz javascript example with array
var questions = [ ["What is the capital of England?", "LONDON", "You know, where the queen lives"], ["What is the capital of France?", "PARIS", "Remember the eiffel tower?"], ["What is the c... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5