What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-27 22:10:41
drupal tag filter ajax content
<?php /** * @file * Module file for Popolo Custom. */ /** * Implements hook_form_alter(). */ function popolo_custom_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id){ // Apply the form_alter to a specific ... Add solution -
Javascript 2022-01-27 19:50:26
ellipsis javascript
function sum(x, y, z) { return x + y + z; } const numbers = [1, 2, 3]; console.log(sum(...numbers)); // expected output: 6 console.log(sum.apply(null, numbers)); // expected output: 6 /* Spread syntax (...) allows an iterable such as an array expres... Add solution -
Javascript 2022-01-27 04:21:06
how to filter object in javascript
// use filter() function. Let say we have array of object. let arr = [ {name: "John", age: 30}, {name: "Grin", age: 10}, {name: "Marie", age: 50}, ]; //Now I want an array in which person having age more than 40 is not ... Add solution -
Javascript 2022-01-26 07:40:31
Working with XLSX in JavaScript
/* This code comes from Vincent Lab And it has a video version linked here: https://www.youtube.com/watch?v=TDGsVqVzW4A */ // Import dependencies const fs = require("fs"); const XLSX = require("xlsx"); const jsontoxml = requir... Add solution -
Javascript 2022-01-26 02:46:21
javascript, reduce
const sum = array.reduce((accumulator, element) => { return accumulator + element; }, 0); // An example that will loop through an array adding // each element to an accumulator and returning it // The 0 at the end initializes accumulator to start at ... Add solution -
TypeScript 2022-01-25 06:20:57
call appply bind
function foo(arg1, arg2){console.log(`I am ${this.bar}. I am ${arg1}. I am ${arg2}`)}; foo(); // I am undefined. I am undefined. I am undefined bindFoo = foo.bind({bar: 'bar'}, 'argument1', 'argument2'); // bind but call later bindFoo(); // I am bar. I a... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5