Skip to content

Instantly share code, notes, and snippets.

@PatMB30
PatMB30 / arrayComparisonWhenMiddleIsString.js
Created March 15, 2018 21:38
testing the comparison and reversing if middle element is non-numerical
// Copyright (C) 2015 Patrick G. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: arrayComparison reorders the elements of the array in reverse using Array.reverse
description: testing the comparison and reversing if middle element is non-numerical
---*/
var arr1 = [2,4,"string",6,8];
var arr1Copy = arr1.reverse();