Comments (4)
Hi @shaikhanis here is a Javascript
code snippet of a basic function that returns the above asked series. There is no such input in Javascript in the terminal but you can use prompt
function which will work in the browser to take input. Or just you a input field.
const series = (n) => {
if (n < 1) return [];
let answer = [1]
for(var i = 1; i < n ; i++ ) {
var number = answer[i-1] + Math.floor(i/2)*2 + 1
answer.push(number);
}
return answer;
}
var n = 15 // Length of the series to be printed
const answer = series(n)
console.log(answer);
from tutoringtrainingstudents.
Thank you so much. I was able to put your code in codepen, and I can confirm it works.
https://codepen.io/jay-pancodu/pen/BaPVzEW
// [object Array] (15)
[1,2,5,8,13,18,25,32,41,50,61,72,85,98,113]
I have no idea what the pattern in the number is.
I literally have no clue how to do these puzzle things. When I was in college, I failed majority of coding tests and exams. and all the jobs I applied, they would give me coding tests, and I will just tell them that I am not eligible and walk out of the interview.
So, thank you for helping out here. much appreciated.
from tutoringtrainingstudents.
Try to format your question/challenges. Nice Title. Using markdown.
if you don't know about markdown, I have made a video, available on YouTube.
from tutoringtrainingstudents.
Students
see if you can solve this challenge from Shaik.
Thanks
Jay.
from tutoringtrainingstudents.
Related Issues (20)
- Assignment 1 HOT 2
- Mini Project Diary Location HOT 2
- college javascript or python project submission HOT 3
- My Photo web Home Page... HOT 1
- JS Doubt : functions HOT 1
- portfolio doubt HOT 4
- Pointer Trail HOT 1
- Solving some Function Question HOT 1
- Local Storage HOT 4
- How to use mark down in github HOT 1
- Issue in Recursion Function HOT 5
- Nasa project not working HOT 4
- working on add a display history feature to a simple calculator project HOT 6
- CSS Assignment Breakfast Places in Mumbai HOT 10
- Link (Github) will not work. HOT 5
- Query related to API key HOT 2
- Json Data for assignment and mini project HOT 1
- demoing asking doubts on twitch workshop
- NASA APOD XHR Project HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tutoringtrainingstudents.