Giter Club home page Giter Club logo

Comments (4)

Mayank-Jain-1 avatar Mayank-Jain-1 commented on June 17, 2024 3

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.

Jay-study-nildana avatar Jay-study-nildana commented on June 17, 2024 1

@Mayank-Jain-1

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.

Jay-study-nildana avatar Jay-study-nildana commented on June 17, 2024

@shaikhanis

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.

https://youtu.be/B-tEeGhUX80

from tutoringtrainingstudents.

Jay-study-nildana avatar Jay-study-nildana commented on June 17, 2024

Students

see if you can solve this challenge from Shaik.

Thanks

Jay.

from tutoringtrainingstudents.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.