---
title: "Hari Krishna Anem (@hkrishna) | Hashnode"
description: "Full stack developer. Read the latest articles by Hari Krishna Anem on Hashnode."
url: "https://hashnode.com/@hkrishna"
---

@hkrishna

# Hari Krishna Anem

@hkrishna · Hyderabad, India · Joined August 2022

Full stack developer

[Website](https://harikrishna.netlify.app/)

### [Find the second largest number in a array](https://harikrishna.hashnode.dev/find-the-second-largest-number-in-a-array?utm_source=hashnode&utm_medium=feed)

function findSecondLargest(arr) { // Sort the array in descending order arr.sort(function(a, b) { return b - a; }); // Return the element at index 1 (the second largest) return arr\[1\]; } // Example usage const numbers = \[10, 5, 8, 20,...

1 min read · [harikrishna.hashnode.dev](https://harikrishna.hashnode.dev/find-the-second-largest-number-in-a-array?utm_source=hashnode&utm_medium=feed)

[Sep 19, 2023](https://hashnode.com/posts/find-the-second-largest-number-in-a-array/65092f9f83cfc2d7e22db67e)

### [Sleep method to wait before executing the next code](https://harikrishna.hashnode.dev/sleep-method-to-wait-before-executing-the-next-code?utm_source=hashnode&utm_medium=feed)

const sleep = (delay) => { return new Promise((resolve, reject) => { setTimeout(resolve, delay); }); }; async function processData() { console.log("Print immediately") await sleep(5000); console.log("Print after 5 seconds") } processD...

1 min read · [harikrishna.hashnode.dev](https://harikrishna.hashnode.dev/sleep-method-to-wait-before-executing-the-next-code?utm_source=hashnode&utm_medium=feed)

[Nov 29, 2022](https://hashnode.com/posts/sleep-method-to-wait-before-executing-the-next-code/638638207893759c464f0aa0)

### [Move 0's in the front and non-zeroes at the end](https://harikrishna.hashnode.dev/move-0s-in-the-front-and-non-zeroes-at-the-end?utm_source=hashnode&utm_medium=feed)

const numbers = \[1, 0, 3, 4, 0, 0, 5, true, "js", 2, 0, 7, 0, 9, false, 0\]; function moveAllZeroesToFront () { return \[...numbers.filter(item => !item && Number(item) === item), ...numbers.filter(item => item !== 0)\]; } const arr = moveAllZeroes...

1 min read · [harikrishna.hashnode.dev](https://harikrishna.hashnode.dev/move-0s-in-the-front-and-non-zeroes-at-the-end?utm_source=hashnode&utm_medium=feed)

[Nov 25, 2022](https://hashnode.com/posts/move-0s-in-the-front-and-non-zeroes-at-the-end/6380960bc160b1d232218b1b)

### [Global, local variable scope with example](https://harikrishna.hashnode.dev/global-local-variable-scope-with-example?utm_source=hashnode&utm_medium=feed)

var age = 30; function getAge () { if ( age === undefined ) { var age = 20; return age; } else { return age; } } console.log(getAge()); Output: 20 Execute above code here

1 min read · [harikrishna.hashnode.dev](https://harikrishna.hashnode.dev/global-local-variable-scope-with-example?utm_source=hashnode&utm_medium=feed)

[Nov 22, 2022](https://hashnode.com/posts/global-local-variable-scope-with-example/637cb0bc8f9f236f36009dbc)

### [Get the current/user time zone without any libraries](https://harikrishna.hashnode.dev/get-the-currentuser-time-zone-without-any-libraries?utm_source=hashnode&utm_medium=feed)

const timezone = Intl .DateTimeFormat() .resolvedOptions() .timeZone; console.log('timezone:', timezone); output: timezone: Asia/Calcutta

1 min read · [harikrishna.hashnode.dev](https://harikrishna.hashnode.dev/get-the-currentuser-time-zone-without-any-libraries?utm_source=hashnode&utm_medium=feed)

[Jan 22, 2022](https://hashnode.com/posts/get-the-currentuser-time-zone-without-any-libraries/6373191dfa286fc922cab1dc)
