Skip to content

Commit

Permalink
Create Easy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
perk-bevis authored Dec 20, 2024
1 parent 9c02b57 commit 80648c5
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions hackerank/Easy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
const countries = [
'Albania',
'Bolivia',
'Canada',
'Denmark',
'Ethiopia',
'Finland',
'Germany',
'Hungary',
'Ireland',
'Japan',
'Kenya'
]

const webTechs = [
'HTML',
'CSS',
'JavaScript',
'React',
'Redux',
'Node',
'MongoDB'
]

const arr = []
console.log(arr)
const number = [1,2,3,4,5,6]
console.log(number)
const lengthOfCountries = countries.length;
const lengthOfwebTechs = webTechs.length;
console.log(lengthOfCountries);
console.log(lengthOfwebTechs);
const first = countries[0];
const middle = countries[Math.floor(countries.length / 2)];
const last = countries[countries.length - 1];
console.log("First:", first);
console.log("Middle:", middle);
console.log("Last:", last);
const secondfirst = webTechs[0]
const secondmiddle = webTechs[Math.floor(webTechs.length/2)]
const secondlast = webTechs[webTechs.length -1];
console.log("secondfirst:", secondfirst);
console.log("secondmiddle:",secondmiddle);
console.log("secondlast:", secondlast);
const mixedDataTypes = [
42,
'Hello',
true,
null,
{ name: 'Alice' },
[1, 2, 3],
undefined
];
const mixedDataTypess =mixedDataTypes.length
console.log(mixedDataTypes)
const itCompanies = ['Facebook', 'Google', 'Microsoft', 'Apple', 'IBM', 'Oracle' ,'Amazon']
console.log(itCompanies)
console.log(itCompanies.length)
const firsts = itCompanies[0];
const middles = itCompanies[Math.floor(itCompanies.length / 2)];
const lasts = itCompanies[itCompanies.length - 1];
console.log("First:", firsts);
console.log("Middle:", middles);
console.log("Last:", lasts);

0 comments on commit 80648c5

Please sign in to comment.