What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-16 09:30:04
bootstrap hide navbar
const navLinks = document.querySelectorAll('.nav-item') const menuToggle = document.getElementById('navbarSupportedContent') const bsCollapse = new bootstrap.Collapse(menuToggle) navLinks.forEach((l) => { l.addEventListener('click', () => { bsCo... Add solution -
Other 2022-03-13 06:15:16
1. Given a phrase, count the occurrences of each word in that phrase.
function count(str) { var obj = {}; str.split(" ").forEach(function(el, i, arr) { obj[el] = obj[el] ? ++obj[el] : 1; }); return obj; } console.log(count("olly olly in come free")); Add solution -
PHP 2022-03-11 16:50:21
php sort file names by date
<?php // get current directory path $dirpath = getcwd(); // set file pattern $dirpath .= "\*.jpg"; // copy filenames to array $files = array(); $files = glob($dirpath); // sort files by last modified date usort($files, function($x, $y) { ... Add solution -
Javascript 2022-03-11 05:30:33
javascript for group object properties based on another property
var list = [ { date: "2017-01-01", type: "type1", amount: 100 }, { date: "2017-01-01", type: "type2", amount: 150 }, { date: "2017-01-02",... Add solution -
PHP 2022-03-10 23:35:04
get item from collection that match
$artist = 'Vincent John Doe'; // you can filter the collection and keep only those items // that pass a given truth test: $art_collection = $paintings->filter(function ($painting) use ($artist) { return $painting->artist == $artist; }); // you c... Add solution -
PHP 2022-03-10 16:20:23
how to use for foreach loop in carousel in laravel blade
<div id="carouselExampleControls" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> @foreach( $photos as $photo ) <li data-target="#carouselExampleIndicato... Add solution