const result = Object.values(arr.reduce((acc, n) => (
acc[n.id] = n.checked ? n : (acc[n.id] || n),
acc
), {}));
const result = arr.reduce((acc, n) => {
const i = acc.findIndex(m => m.id === n.id);
if (!~i || (!acc[i].checked && n.checked)) {
acc.push(n);
if (~i) {
acc.splice(i, 1);
}
}
return acc;
}, []);
// или
const result = Object
.values(arr.reduce((acc, n, i) => (
(!acc[n.id] || (!acc[n.id][0].checked && n.checked)) && (acc[n.id] = [ n, i ]),
acc
), {}))
.sort((a, b) => a[1] - b[1])
.map(n => n[0]);
.carousel-control .icon-next {
transform: rotate(180deg);
}
/* или так */
.carousel-control .icon-next {
transform: scaleX(-1);
}
<div id="vk_widget">
<div id="vk_groups"></div>
</div>
<script type="text/javascript" src="//vk.com/js/api/openapi.js?116"></script>
<script>
function VK_Widget_Init(){
document.getElementById('vk_groups').innerHTML = "";
var vk_width = document.getElementById('vk_widget').clientWidth;
VK.Widgets.Group("vk_groups", {mode: 0, width: vk_width, height: "241", color1: "2B2B2B", color2: "FFFFFF", color3: "2B2B2B"}, 26292363);
};
window.addEventListener('load', VK_Widget_Init, false);
window.addEventListener('resize', VK_Widget_Init, false);
</script>
#vk_widget, #vk_groups {
width: 100%;
}
.spoiler-block{position:absolute;}
function register_myscripts() {
wp_deregister_script('jquery');
wp_register_script('jquery', get_template_directory_uri() .
'/assets/js/jquery.js');
wp_enqueue_script('jquery');
}
add_action('wp_enqueue_scripts', 'register_myscripts');