“réverse” Réponses codées

tableau inversé PHP

$array= array(1,2,3,4,5);
$reversedArray = array_reverse($array);

var_dump($y);
Annoyed Albatross

tableau inversé JavaScript

var arr = [34, 234, 567, 4];
print(arr);
var new_arr = arr.reverse();
print(new_arr);
Black Footed Ferret

réverse

#The original array
arr = [11, 22, 33, 44, 55]
print("Array is :",arr)
 
res = arr[::-1] #reversing using list slicing
print("Resultant new reversed array:",res)
Splendid Serval

réverse

const array1 = ['one', 'two', 'three'];
console.log('array1:', array1);
// expected output: "array1:" Array ["one", "two", "three"]

const reversed = array1.reverse();
console.log('reversed:', reversed);
// expected output: "reversed:" Array ["three", "two", "one"]

// Careful: reverse is destructive -- it changes the original array.
console.log('array1:', array1);
// expected output: "array1:" Array ["three", "two", "one"]
Agustín Tajani

réverse

int[] intArray = { 1, 2, 3, 4, 5 };
ArrayUtils.reverse(intArray);
System.out.println(Arrays.toString(intArray));
//[5, 4, 3, 2, 1]
Hilarious Horse

réverse

[ "a", "b", "c" ].reverse   #=> ["c", "b", "a"]
[ 1 ].reverse               #=> [1]
Bruno Leite

Réponses similaires à “réverse”

Questions similaires à “réverse”

Plus de réponses similaires à “réverse” dans Java

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code