This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'category_name' => 'news', | |
'posts_per_page' => 3 | |
); | |
$my_query = new WP_Query( $args ); | |
if ( $my_query->have_posts() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsort = (arr) => { | |
if (arr.length < 2) { | |
return arr; | |
} else { | |
// Опорная точка для деления массива, выбирается случайно | |
const pivotPosition = Math.floor(Math.random() * arr.length); | |
const pivot = arr[pivotPosition]; | |
// Значения меньшие, либо равные опорному | |
// попадают в новый массив less | |
const less = arr.filter((value, index) => { |