What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-09 11:34:04
js loop through array
var data = [1, 2, 3, 4, 5, 6]; // traditional for loop for(let i=0; i<=data.length; i++) { console.log(data[i]) // 1 2 3 4 5 6 } // using for...of for(let i of data) { console.log(i) // 1 2 3 4 5 6 } // using for...in for(let i in data) { con... Add solution -
Java 2021-10-09 08:22:14
how to set two different table admin and user for separate jwt token in spring boot
private Set getAuthority(User user) { Set authorities = new HashSet<>(); user.getRoles().forEach(role -> { authorities.add(new SimpleGrantedAuthority("ROLE_" + role.getName())); }); return authorities; } Add solution -
Other 2021-10-08 05:19:02
Search wikipedia
// JavaScript Document let resultsList = document.getElementById('resultsList'); let searchForm = document.getElementById('searchForm'); let searchInput = document.getElementById('searchInput'); searchForm.addEventListener('submit', (e)=> { e.preven... Add solution -
Javascript 2021-10-08 02:26:07
binary agents freecodecamp
const binaryAgent = str => { let string = '' str.split(' ').forEach(elem => { // Converts binary numbers to base 2 const toBase = Number.parseInt(elem, 2) // Then convert the ASCII code which is now (toBase) to unicode string +=... Add solution -
TypeScript 2021-10-06 19:07:05
map vs for each
forEach() just loop through the elements. It's throws away return values and always returns undefined.The result of this method does not give us an output . map() loop through the elements allocates memory and stores return values by iterating main array... Add solution -
Javascript 2021-10-06 03:40:03
how to delete multiple rows using checkbox in angular 7
You can declare an array to store IDs of selected checkboxes. SelectedIDs:any[]; On check of any row you can store id in above array. selectID(id, event:any){ this.SelectedIDs.push(id); } On click of delete button you can pop up elements with matchi... Add solution