What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-04 10:58:04
javascript object toarray
var obj = {"1":5,"2":7,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0} var result = Object.keys(obj).map(function(key) ... Add solution -
TypeScript 2021-10-03 19:16:06
reverse a string if its value its greater than 3
var s = 'This is a short sentence' // set test sentence , e = s.split(' ') // 'This is a short sentence' ==> ['This','is','a','short','sentence'] .map(function(v,i,a){ // REPLACE the value of the current index in the array ... Add solution -
Javascript 2021-10-03 09:55:03
reactjs basic example
// -------// -------// ------- // index.js // -------// -------// ------- const user = { name: "zidane", email: '[email protected]' }; const element = <h1> {user.name} exist email: {user.email} </h1>; const element2 = <... Add solution -
Javascript 2021-09-30 11:05:03
jquery get multiple input values by name
<input name="titles[]"> <input name="titles[]"> <button>submit</button> // click handler function onClick(event) { var titles = $('input[name^=titles]').map(function(idx, elem) { return $(elem).val(); }... Add solution -
Javascript 2021-09-26 01:51:05
select with row id d3.js
function tabulate(data, columns) { var table = d3.select("#container").append("table"), thead = table.append("thead"), tbody = table.append("tbody"); // append the header row thead.append("tr") ... Add solution -
Javascript 2021-09-25 15:57:04
d3 violin plot with points
<script> // set the dimensions and margins of the graph var margin = {top: 10, right: 30, bottom: 30, left: 40}, width = 460 - margin.left - margin.right, height = 400 - margin.top - margin.bottom; // append the svg object to the body of t... Add solution -
TypeScript 2021-09-25 09:09:04
array of objects create common key as a property and create array of objects
var data = [{ message: 'This is a test', from_user_id: 123, to_user_id: 567 }, { message: 'Another test.', from_user_id: 123, to_user_id: 567 }, { message: 'A third test.', from_user_id: '456', to_user_id: 567 }], groups = Object.create(null), res... Add solution -
Javascript 2021-09-24 12:47:04
convert object to url javascript
var params = { width:1680, height:1050 }; // Using VanillaJs Object.keys(params).map(function(k) { return encodeURIComponent(k) + "=" + encodeURIComponent(hipChatSettings[k]); }).join('&') //using jQuery var str = jQuery.param( params ); Add solution
Best helpers
Ranking is empty