“Perpustakaan Garis Besar.” Kode Jawaban

Perpustakaan Garis Besar.

_.toPath('key');
=> ['key']
_.toPath(['a', 0, 'b']);
=> ['a', 0, 'b'] // (same array)
Horrible Hummingbird

Perpustakaan Garis Besar.

_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
=> [5, 4, 6, 3, 1, 2]

var stooges = [{name: 'moe', age: 40}, {name: 'larry', age: 50}, {name: 'curly', age: 60}];
_.sortBy(stooges, 'name');
=> [{name: 'curly', age: 60}, {name: 'larry', age: 50}, {name: 'moe', age: 40}];
Horrible Hummingbird

Jawaban yang mirip dengan “Perpustakaan Garis Besar.”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya