Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6531945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:56:23+00:00 2026-05-25T09:56:23+00:00

Here is my CoffeeScript: buffer = new Buffer 100 buffer[i] = i for i

  • 0

Here is my CoffeeScript:

buffer = new Buffer 100
buffer[i] = i for i in [0..99]
console.log buffer

which compiles to

  var buffer, i;
  buffer = new Buffer(100);
  for (i = 0; i < buffer.length; i++) {
    buffer[i] = i;
  }
  console.log(buffer);

When I run it with node, I get the following output:

$ coffee exercise1
<Buffer 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63>

instead of 0 to 99. Why is that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T09:56:24+00:00Added an answer on May 25, 2026 at 9:56 am

    Ray nailed it in his comment. See the Buffer documentation; you have to specify an encoding argument (you probably want 'utf8') on a Buffer’s toString.

    // coffeescript
    console.log buffer.toString 'utf8'
    // javascript
    console.log(buffer.toString('utf8'));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following the advice here I can get a shell script in JavaScript that runs
Here is my code, which takes two version identifiers in the form 1, 5,
Here is the code I’m using: using (StreamWriter output = new StreamWriter(Path.Combine(masterdestination, Master.txt))) {
Here is the problem that I am having. The user can log in but
Here, i have coded to get data from DB. I want to store the
I'm trying to figure out how inheritance works in coffeescript. Here's a simplified example
Given the following coffeescript code: class Animal constructor: (@name) -> speak: (things) -> My
Here is my object constructor static class Edge { int source; // source node
Hey, I am Just Learning CoffeeScript and I Keep getting Errors. Here is my
Here a simple question : What do you think of code which use try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.