Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

without the filter() method

var students = [
  { name: 'Quincy', grade: 96 },
  { name: 'Jason', grade: 84 },
  { name: 'Alexis', grade: 100 },
  { name: 'Sam', grade: 65 },
  { name: 'Katie', grade: 90 }
];
//Define an array to push student objects to.
var studentsGrades = []
for (var i = 0; i < students.length; i++) {
  //Check if grade is greater than 90
  if (students[i].grade >= 90) {
    //Add a student to the studentsGrades array.
    studentsGrades.push(students[i])
  }
}

return studentsGrades; // [ { name: 'Quincy', grade: 96 }, { name: 'Alexis', grade: 100 }, { name: 'Katie', grade: 90 } ]
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native picker select placeholder color 
Javascript :: telerik mvc grid add row 
Javascript :: TOP Array Methods 
Javascript :: Html5 canvas resize image aspect ratio 
Javascript :: mvc return view with query string 
Javascript :: convert javascript to java 
Javascript :: upload file to s3 using pre signed url javascript 
Javascript :: port for sqlexpress not found in desktop node.js 
Javascript :: firebase database TIMESTAMP 
Javascript :: Compiled with problems:X ERROR [eslint] Plugin "react" was conflicted between 
Javascript :: get aggregate sum value in kendo grid footer jquery 
Javascript :: async data nuxt multiple requests 
Javascript :: for loop increment by more than one 
Javascript :: react native avoid keyboard when multiline 
Javascript :: do while 
Javascript :: autoplay images in react js 
Javascript :: style mapbox paint data driven 
Javascript :: javascript function counting cards 
Javascript :: remove a key/value mongo 
Javascript :: getting-host-is-not-configured-error-when-using-next-image 
Javascript :: how to convert numbers to roman numerals in javascript 
Javascript :: plumsail on change event value 
Javascript :: if (arr.indexOf(i) === -1) { return false; 
Javascript :: react-icons/vsc 
Javascript :: How do i filter name in ng-repeat angularjs 
Javascript :: tabbarbadge style react native 
Javascript :: Check AngularJS checkbox with Selenium 
Javascript :: Use of typescript generics for extended parametres 
Javascript :: How to change a key value pair within a nested json structure C# 
Javascript :: vscode search shortcut 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =