{"size": 524, "ext": "js", "max_stars_repo_path": "4. Practice problems/Edabit questions + Interview questions/113. Left shift by Powers of two.js", "max_stars_repo_name": "Pratham82/JavaScript-porgramming", "max_stars_repo_stars_event_min_datetime": "2021-10-21T10:08:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-21T10:08:24.000Z", "max_issues_repo_path": "4. Practice problems/Edabit questions + Interview questions/113. Left shift by Powers of two.js", "max_issues_repo_name": "Pratham82/JavaScript-porgramming", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "4. Practice problems/Edabit questions + Interview questions/113. Left shift by Powers of two.js", "max_forks_repo_name": "Pratham82/JavaScript-porgramming", "max_forks_repo_forks_event_min_datetime": "2021-10-21T10:07:20.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-21T10:07:20.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 32.75, "max_line_length": 131, "alphanum_fraction": 0.6354961832}
// Left Shift by Powers of Two
// The left shift operation is similar to multiplication by powers of two.

// Sample calculation using the left shift operator (<<):

// 10 << 3 = 10 * 2^3 = 10 * 8 = 80
// -32 << 2 = -32 * 2^2 = -32 * 4 = -128
// 5 << 2 = 5 * 2^2 = 5 * 4 = 20
// Write a function that mimics (without the use of <<) the left shift operator and returns the result from the two given integers.

const shiftToLeft = (x, y) => x * Math.pow(2, y)

console.log(shiftToLeft(5, 2))

console.log(shiftToLeft(-32, 2))
